| |
- exceptions.Exception
-
- Error
- TOTException
- KnowsParent
-
- TimeoutTCPServer(SocketServer.TCPServer, KnowsParent)
- SocketServer.TCPServer(SocketServer.BaseServer)
-
- TimeoutTCPServer(SocketServer.TCPServer, KnowsParent)
class TimeoutTCPServer(SocketServer.TCPServer, KnowsParent) |
|
TCP SocketServer that starts in its own thread, and
can be joined and stopped mid-course, with a maximum delay
specified by the timeout.
Also, it can be directed to only serve a specific number
of requests before stopping (e.g.: 1). |
|
- __del__(self)
- __init__(self, port, timeout, handler, max_requests=0, parent=None)
- _abortServer(self)
- _badArgs(self, port, timeout, handler)
- _maxRequestsReached(self, n)
- _signalStarted(self)
- Signal that server thread has started
- _startServer(self)
- Start a server.
This never returns, so needs to be started in its own thread.
The caller should wait for the server_started.notify() before
proceeding (see __init__).
- _waitStarted(self)
- Wait for server thread signal
Pre: server_started lock has been acquire()d
- _waitingForData(self, ready)
- close(self)
- close_request(self, request) from SocketServer.TCPServer
- fileno(self) from SocketServer.TCPServer
- finish_request(self, request, client_address) from SocketServer.BaseServer
- getParent(self) from KnowsParent
- get_request(self)
- Get the request from the socket, with a timeout.
If the server is closed during the select or accept,
then shut down.
- handle_error(self, request, client_address) from SocketServer.BaseServer
- handle_request(self) from SocketServer.BaseServer
- process_request(self, request, client_address) from SocketServer.BaseServer
- serve_forever(self)
- Handle one request at a time until _doomsday.
- server_activate(self) from SocketServer.TCPServer
- server_bind(self) from SocketServer.TCPServer
- server_close(self)
- Close the listening socket and join the thread.
- setParent(self, new) from KnowsParent
- verify_request(self, request, client_address) from SocketServer.BaseServer
| |