Package shttp :: Module http :: Class HTTPServer
[show private | hide private]
[frames | no frames]

Class HTTPServer

BaseServer --+        
             |        
     TCPServer --+    
                 |    
        HTTPServer --+
                     |
BaseServer --+       |
             |       |
     TCPServer --+   |
                 |   |
ThreadingMixIn --+   |
                 |   |
ThreadingTCPServer --+
                     |
                    HTTPServer


Method Summary
  __init__(self, server_address, HandlerClass, ssl_privatekey_file, ssl_certificate_file, ssl_method, cgi_handlers, cgi_directories, document_root)
  close(self)
  helloworld(self, httpreq, environment)
  process_request(self, request, client_address)
Process one request, overloaded to support implement trusted SSL under heavy load
  regcall(self, uri, returntype)
Register uri |uri| to be handled a function...
  register_urihandler(self, uri, handler)
Set an urihandler...
  regobj(self, uri)
  serve_forever(self)
Handles requestgs while self.process_next_request is True
  unregister_urihandler(self, uri)
Deletes the uri-handler associated to |uri|
    Inherited from ThreadingMixIn
  process_request_thread(self, request, client_address)
Same as in BaseServer but as a thread.
    Inherited from HTTPServer
  server_bind(self)
Override server_bind to store the server name.
    Inherited from TCPServer
  close_request(self, request)
Called to clean up an individual request.
  fileno(self)
Return socket file number.
  get_request(self)
Get the request and client address from the socket.
  server_activate(self)
Called by constructor to activate the server.
  server_close(self)
Called to clean-up the server.

Class Variable Summary
    Inherited from ThreadingMixIn
bool daemon_threads = False
    Inherited from HTTPServer
int allow_reuse_address = 1                                                                     
    Inherited from TCPServer
int address_family = 2                                                                     
int request_queue_size = 5                                                                     
int socket_type = 1                                                                     

Method Details

process_request(self, request, client_address)

Process one request, overloaded to support implement trusted SSL under heavy load
Overrides:
SocketServer.ThreadingMixIn.process_request

regcall(self, uri, returntype='text/plain')

Register uri |uri| to be handled a function
This method can be used safelly as decorator

Example
@httpobj.regcall('/selected-uri','text/html')
def square(x):
    int(x)
    return x*x

register_urihandler(self, uri, handler)

Set an urihandler
|uri| The URI to be handled
|handler| a function that handles the event
Prototype:
    function(httpreq, environment)
    httpreq is an HTTPRequestHandler Object

serve_forever(self)

Handles requestgs while self.process_next_request is True
Overrides:
SocketServer.BaseServer.serve_forever

unregister_urihandler(self, uri)

Deletes the uri-handler associated to |uri|

Generated by Epydoc 2.1 on Sat Oct 14 11:50:52 2006 http://epydoc.sf.net