qubx :: sock :: TCPServer :: Class TCPServer
[hide private]
[frames] | no frames]

Class TCPServer

source code

object --+
         |
        TCPServer
Known Subclasses:

Listens for connections on its own thread; calls session_f(each new socket.socket).

Instance Methods [hide private]
 
__init__(self, host, port, session_f, seek_ports=0)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__del__(self) source code
 
stop(self)
Requests the listening thread to stop and close the socket; does not .thread.join().
source code
 
listenThread(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
  host
  port
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, host, port, session_f, seek_ports=0)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • host
  • port - base TCP port number
  • session_f - function(socket.socket) called on each new connection
  • seek_ports - attempts to bind ports (port, port+1, port+2, ..., port+seek_ports) until a port is free
Overrides: object.__init__