qubx :: remote_ctl :: RemoteServer :: Class RemoteServer
[hide private]
[frames] | no frames]

Class RemoteServer

source code

    object --+    
             |    
sock.TCPServer --+
                 |
                RemoteServer

Listens on the first available port in port..(port+seek_ports). Writes the actual port number to a text file at sockid_path, if provided. One RemoteSession per client enqueues requests for processing, but as most applications require everything to run on the same thread, you must call

>>> server.process_one()

at frequent intervals, such as on a timer. To stop the server:

>>> server.stop()
Instance Methods [hide private]
 
__init__(self, host='127.0.0.1', port=55384, seek_ports=10, sockid_path=None, blocking=False, run_on_thread=<__builtin__.function object>, main_globals=None)
Raises socket.error if no ports available.
source code
 
stop(self)
Stops the listening thread and closes the socket.
source code

Inherited from sock.TCPServer: __del__, listenThread

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

Instance Variables [hide private]
 
process_one(self) source code

Inherited from sock.TCPServer: host, port

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, host='127.0.0.1', port=55384, seek_ports=10, sockid_path=None, blocking=False, run_on_thread=<__builtin__.function object>, main_globals=None)
(Constructor)

source code 

Raises socket.error if no ports available.

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__

stop(self)

source code 

Stops the listening thread and closes the socket.

Overrides: sock.TCPServer.stop