Package HappyChat :: Module HappyServer :: Class _HappyServer
[show private | hide private]
[frames | no frames]

Class _HappyServer

  Factory --+    
            |    
ServerFactory --+
                |
               _HappyServer


Server Singleton

can be call by the HappyServer method
Method Summary
  __init__(self, id, hostname, port, protocol)
  createSession(self, nickname)
Create a chat session, get user information and store it in a temporary object before avatar creation.
tuple as (hostname, port) getConfig(self)
get the server configuration to access to.
  getInfo(self)
return the server information as a dictionary list
boolean isRuning(self)
State of the server
  run(self)
The main server loop
  start(self)
Start the HappyChat Server
  startExternalAccess(self)
put the lock or wait
  startFactory(self)
Construct the server structure
  stop(self)
Stop the server
  stopExternalAccess(self)
free the lock
  stopFactory(self)
Delete server structure XXX: will be use to store avatar informations in ZODB.
    Inherited from Factory
  buildProtocol(self, addr)
Create an instance of a subclass of Protocol.
  doStart(self)
Make sure startFactory is called.
  doStop(self)
Make sure stopFactory is called.

Class Variable Summary
NoneType instance: Unique instance of the singleton
NoneType protocol = None                                                                  
    Inherited from Factory
tuple __implements__ = (<class 'twisted.internet.interfaces.IP...
str noisy = 'sure, why not'
int numPorts = 0                                                                     

Method Details

__init__(self, id, hostname, port, protocol)
(Constructor)

Parameters:
protocol - A protocol class that define handler method.
           (type=HappyChatProtocol)

createSession(self, nickname)

Create a chat session, get user information and store it in a temporary object before avatar creation.
Returns:
the session identifier

getConfig(self)

get the server configuration to access to.
Returns:
hostname and port
           (type=tuple as (hostname, port))

getInfo(self)

return the server information as a dictionary list

isRuning(self)

State of the server
Returns:
True is server is running
           (type=boolean)

run(self)

The main server loop

start(self)

Start the HappyChat Server

startExternalAccess(self)

put the lock or wait

startFactory(self)

Construct the server structure
Overrides:
twisted.internet.protocol.Factory.startFactory

stop(self)

Stop the server

stopExternalAccess(self)

free the lock

stopFactory(self)

Delete server structure XXX: will be use to store avatar informations in ZODB.
Overrides:
twisted.internet.protocol.Factory.stopFactory

Class Variable Details

instance

Unique instance of the singleton
Type:
NoneType
Value:
None                                                                  

protocol

Type:
NoneType
Value:
None                                                                  

Generated by Epydoc 2.1 on Sun Sep 19 21:40:09 2004 http://epydoc.sf.net