Package cobra :: Module http :: Class CobraHttpDaemon
[hide private]
[frames] | no frames]

Class CobraHttpDaemon

source code


Instance Methods [hide private]
 
__init__(self, host="", port=COBRA_PORT, sslcrt=None, sslkey=None, sslca=None, sess_timeout=24, attr=True)
Construct a cobra daemon object.
source code
 
_timeoutSessions(self) source code
 
fireThread(self) source code
 
setAuthModule(self, authmod)
Enable an authentication module for this server ( all connections *must* be authenticated through the authmod )
source code
 
getSharedObject(self, name) source code
 
shareObject(self, obj, name=None, doref=False)
Share an object in this cobra server.
source code

Inherited from SocketServer.ThreadingMixIn: process_request, process_request_thread

Inherited from SocketServer.TCPServer: close_request, fileno, get_request, server_activate, server_bind, server_close, shutdown_request

Inherited from SocketServer.BaseServer: finish_request, handle_error, handle_request, handle_timeout, serve_forever, shutdown, verify_request

Inherited from SocketServer.BaseServer (private): _handle_request_noblock

Class Variables [hide private]

Inherited from SocketServer.ThreadingMixIn: daemon_threads

Inherited from SocketServer.TCPServer: address_family, allow_reuse_address, request_queue_size, socket_type

Inherited from SocketServer.BaseServer: timeout

Method Details [hide private]

__init__(self, host="", port=COBRA_PORT, sslcrt=None, sslkey=None, sslca=None, sess_timeout=24, attr=True)
(Constructor)

source code 

Construct a cobra daemon object.

Parameters: host - Optional hostname/ip to bind the service to (default: inaddr_any) port - The port to bind (Default: COBRA_PORT) timeout - The length any session can last, before forcing reconnect attr - Toggle to turn off the ability to set or get attributes

# SSL Options sslcrt / sslkey - Specify sslcrt and sslkey to enable SSL server side sslca - Specify an SSL CA key to use validating client certs

Overrides: SocketServer.BaseServer.__init__

setAuthModule(self, authmod)

source code 

Enable an authentication module for this server
( all connections *must* be authenticated through the authmod )

NOTE: See cobra.auth.* for various auth module implementations

Example:
    import cobra.auth.shadow as c_a_shadow
    authmod = c_a_shadow.ShadowFileAuth('passwdfile.txt')
    cdaemon = CobraDaemon()
    cdaemon.setAuthModule()

shareObject(self, obj, name=None, doref=False)

source code 

Share an object in this cobra server. By specifying doref=True you will let CobraProxy objects decide that the object is done and should be un-shared. Also, if name == None a random name is chosen.

Returns: name (or the newly generated random one)