Server DNC  1.0
A TCP chat server implementation
Namespaces | Functions | Variables
/home/sidya/PycharmProjects/DNC/serveur/Server.py File Reference

Namespaces

 Server
 Module server.
 

Functions

def Server.main ()
 Load Configuration and Start the Server. More...
 
def Server.handle_connection (connection, client_address)
 Handle a connection from a client. More...
 
def Server.handle_request (connection, data)
 Handle a request. More...
 
def Server.broadcast_message (connection, message)
 Broadcast a message to all the users connected except to the sender of the request. More...
 
def Server.user_list_active (connection)
 Send the list of enable user. More...
 
def Server.user_list_away (connection)
 Send the list of disable user. More...
 
def Server.change_name (connection, pseudo)
 Change the nickname of the user. More...
 
def Server.new_name (connection, pseudo)
 Affect the nickname of the user for the first time. More...
 
def Server.ask_private_message (connection, pseudo)
 Ask for a private discussion between the sender of the request and the pseudo. More...
 
def Server.accept_private_message (connection, pseudo)
 Accept a private discussion. More...
 
def Server.reject_private_message (connection, pseudo)
 Reject a private discussion. More...
 
def Server.private_message (connection, pseudo, msg)
 Send a private message if a private discussion had been accepted. More...
 
def Server.ask_file (connection, pseudo, file)
 Ask for a file transfer between the sender of the request and the pseudo. More...
 
def Server.accept_file (connection, pseudo, file, port)
 Accept a file transfer. More...
 
def Server.reject_file (connection, pseudo, file)
 Reject a file transfer. More...
 
def Server.enable_user (connection)
 Enable user. More...
 
def Server.disable_user (connection)
 Disable user. More...
 
def Server.quit_user (connection)
 Disconnect user. More...
 
def Server.get_connection_by_pseudo (pseudo)
 Get the socket descriptor by a pseudo. More...
 

Variables

int Server.USERLIST_ENABLE = 300
 
int Server.USERLIST_DISABLE = 301
 
int Server.HAS_JOIN = 302
 
int Server.HAS_LEFT = 303
 
int Server.NEW_MSG = 304
 
int Server.NAME_CHANGED = 305
 
int Server.NEW_PM = 306
 
int Server.ASKING_FOR_PM = 307
 
int Server.PRIVATE_DISCU_ACCEPTED_FROM = 308
 
int Server.PRIVATE_DISCU_REFUSED_FROM = 309
 
int Server.IS_NOW_ENABLE = 310
 
int Server.IS_NOW_DISABLE = 311
 
int Server.HAS_ASKED_FILE = 312
 
int Server.CAN_SEND_FILE = 313
 
int Server.HAS_REJECT_FILE = 314
 
int Server.SUCC_CHANNEL_JOINED = 200
 
int Server.SUCC_CHANNEL_QUIT = 201
 
int Server.SUCC_MESSAGE_SENDED = 202
 
int Server.SUCC_NICKNAME_CHANGED = 203
 
int Server.SUCC_PM_SENDED = 205
 
int Server.SUCCESSFUL_ASKED_CONV = 206
 
int Server.SUCCESSFUL_ACCEPTED_CONV = 207
 
int Server.SUCCESSFUL_REFUSED_CONV = 208
 
int Server.SUCC_ENABLED = 209
 
int Server.SUCC_DISABLED = 210
 
int Server.SUCC_PMFILE = 211
 
int Server.SUCC_ACCEPTED_FILE = 212
 
int Server.SUCC_REFUSED_FILE = 213
 
int Server.ERR_NICKNAME_ALREADY_USED = 400
 
int Server.ERR_NO_NICKNAME = 401
 
int Server.ERR_CONV_NOT_ALLOWED = 402
 
int Server.DEST_NOT_FOUND = 403
 
int Server.ERR_ALREADY_ASKED_FOR_PM = 404
 
int Server.ERR_NO_INVIT_TO_CONV_FOUND = 405
 
int Server.ERR_UNKNOWN_ACCEPTED_FILE = 406
 
int Server.COMMAND_NOT_FOUND = 407
 
int Server.ERR_INVALID_NICKNAME = 408
 
int Server.ERR_INTERNAL_SERVER_ERROR = 409
 
int Server.ERR_NOT_DISABLED = 410
 
int Server.ERR_NOT_ENABLED = 411