Constructor
Constructor
Connection handler method.
Handles HTTP exception e which was thrown while parsing the request message or from handleRequest() or request_msg_body_length(). A subclass may override this method to be notified when an exception is thrown and decide whether the connection may stay persistent or should be closed after the response has been sent. The default behaviour is allowing the connection being persistent unless the status code indicated by the exception is 413: "Request Entity Too Large".
Handles HTTP server exception e which was thrown while parsing the request message or from handleRequest() or request_msg_body_length() and is not a HttpException. A subclass may override this method to be notified when an exception is thrown and decide whether the connection may stay persistent or should be closed after the response has been sent. The default behaviour is allowing the connection to stay persistent.
Handles the request. This method is called while a task is running, see ocean.task.Task.
Called when an IOWarning or IOError is caught. May be overridden by a subclass to be notified.
Called after handleRequest() has returned and when the response message buffer is no longer referenced or after handleRequest() has thrown an exception. A subclass may override this method to release resources. This is useful especially when a large number of persistent connections is open where each connection is only used sporadically.
Tells the request message body length. This method should be overridden when a request message body is expected. It is invoked when the message header is completely parsed. The default behaviour is expecting no request message body.
Resettable interface method; resets the request.
Status code for the case when a required message header parameters are missing.
Reused exception instance; may be thrown by a subclass as well.
Maximum number of requests through the same connection when using persistent connections; 0 disables using persistent connections.
HTTP request message parser
HTTP response message generator
Reads data from and writes data to the connection socket.
IOWarning exception instance used by the reader/writer and subclass.
Called by finalize to unregister the connection socket from epoll before closing it. This is done because closing a socket does not always mean that it is unregistered from epoll -- in situations where the process has forked, the fork's reference to the underlying kernel file description will prevent it from being unregistered until the fork exits. Therefore, to be certain that the socket will not fire again in epoll, we need to explicitly unregister it.
Called by the select listener right after the client connection has been assigned. If this method throws an exception, error() and finalize() will be called by the select listener.
Connection handler method, called from a running task.
Called by IConnectionHandler.finalize(), in order to determine if an I/O error was reported for the connection conduit which made the connection automatically being closed. (See comment for IConnectionHandler.finalize() method.)
ditto