This server class uses asyncore to accept and dispatch
requests.
Methods
|
|
|
|
__init__
|
__init__ (
self,
sock,
conf_filename,
)
|
|
add_user_connection
|
add_user_connection (
self,
uid,
connection,
)
Associated a connection with a user id so that
when a message needs to be sent to a particular
user it is easy to look up the value.
|
|
drop_user_connection
|
drop_user_connection ( self, uid )
Forget about the connection to a particular
user.
|
|
get_user_connection
|
get_user_connection ( self, uid )
Return the connection for the user specified by
uid, unless that user is not connected. If the
user is not connected, raises a KeyError.
|
|
handle_accept
|
handle_accept ( self )
|
|
handle_close
|
handle_close ( self )
|
|
handle_connect
|
handle_connect ( self )
|
|
handle_expt
|
handle_expt ( self )
|
|
handle_oob
|
handle_oob ( self )
|
|
handle_read
|
handle_read ( self )
|
|
handle_write
|
handle_write ( self )
|
|
log
|
log ( self, message )
|
|
loop
|
loop ( self )
|
|
read_conf_files
|
read_conf_files ( self )
Read the configuration files which control
the server behavior.
Exceptions
|
|
WimdServerError( 'Could not open configuration file.', self.conf_filename, str(msg.args [ 1 ] ), )
|
|
|
send_motd
|
send_motd ( self, conn )
Given a connection, send the message of the day.
|
|
wimd_MESG
|
wimd_MESG (
self,
fromuid,
nick,
touid,
msg,
)
Given a UID and a message, send the message to that
user.
|
|
wimd_UPDT
|
wimd_UPDT (
self,
message_type,
nick,
uid,
message='',
)
|
|