Home | Trees | Indices | Help |
---|
|
object --+ | threading._Verbose --+ | threading.Thread --+ | TCPServer --+ | HTTPServer
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
Static Methods | |||
|
|||
Inherited from |
Class Variables | |
Inherited from |
Properties | |
Inherited from Inherited from |
Method Details |
Creates a HTTP server (inherited from TCPServer) that listens for a connecting client on given port (default = 80). Starts a thread that handles and returns HTTP GET requests. The HTTP respoonse header reports the given server name (default: "PYSERVER") requestHandler() is a callback function called when a GET request is received. Signature: msg, stateHandler = requestHandler(clientIP, filename, params) Parameters: clientIP: the client's IP address in dotted format filename: the requested filename with preceeding '/' params: a tuple with format: ((param_key1, param_value1), (param_key2, param_value2), ...) (all items are strings) Return values: msg: the HTTP text response (the header is automatically created) stateHandler: a callback function that is invoked immediately after the reponse is sent. If stateHandler = None, nothing is done. The function may include longer lasting server actions or a wait time, if sensors are not immediately ready for a new measurement. Call terminate() to stop the server. The connection is closed by the server at the end of each response. If the client connects, but does not send a request within 5 seconds, the connection is closed by the server.
|
Returns the dotted IP of a connected client. If no client is connected, returns empty string. |
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Jan 17 12:05:13 2018 | http://epydoc.sourceforge.net |