úÎ< 7     NoneNoneA Simple Server =Describes a Clients connection and provides an interface for Cstoring data associated with the client. Each client will be given $a unique cid and are Eq if their cid' s are Eq. FA ClientConn comes packaged with two functions for storing additional ?information in Strings, lookup and modify. The lookup function Btakes a key and returns the current value of the key or the empty 5string if it has never been set. The modify function @takes a key and value and updates it such that the next call to 5lookup with that key will return the value provided. The Unique ID for this client VLooks up a property for this client. By default, all properties are the empty string. ’Modifies a client property. Given a property string, and a value string, the next call to lookup for the given property will result in the value. RA DisconnectHandler is called each time a client is disconnected from the server. `Each server has one ConnectionHandler that is called each time a client connects to the server. LA server may have any number of CmdHandlers. When a CmdHandler is called it Nis passed a list of strings representing the message the server received, the Iserver that received it, and the client that send the message. The first Fpart element of the list is the string that triggered the CmdHandler. QCreates a new server with the specified ConnectionHandler and DisconnectHandler. NOn a call to start, the server will attempt to connect on the specified Port. ?If a client does not talk to a server for more than 60 seconds it will be disconnected. JGiven a server, a command, and a command handler, adds the command to the ?server. If the command already exists, it will be overwritten. MStarts a server if it is currently not started. Otherwise, does nothing. The Kserver will be started on a new thread and control will be returned to the "thread that called this function. =Stops a server if it is running sending a disconnect message @to all clients and killing any threads that have been spawned. Otherwise, does nothing. >Any shutdown operations should be run before this is called. FAdds a message to the clients message queue to be handled eventually. FAdds a message to all clients message queue to be handled eventually. BDisconnects the client if they are still connected to the server. IReturns a list of all clients that are currently connected to the server  Creates a new client connection 3The main loop for the server. Checks to see if the 8server has started, if it has it checks for any clients Fwho need to be disconnected then processes any commands in its queue. LEvery 30 seconds, the server will check to see if a client has disconnected <or timed out and remove those clients from the client list. AAfter processing the loop continues until the server is stopped. 0If there are no commands, it will wait approx. 1/10th of a second before continuing. <Using a servers command table, processess the a message. If Jthe message cannot be processed, a message is added to its response queue 7Checks for dead or timed out clients and removes them. 5Accepts a connection and adds it to the clients list G !"#$%&'()*+,-./0123456789:; <=>?@ABCDEFGHIJKLMNO   + !"#$% &'()*+,-./012 3456789:; <=>?@ABCDEFGHIJKLMNONonePQRSTUVWXYZ[\]^_`PQRSTUVWXYZ[\]^_`a       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^simple-server-0.0.2(Network.SimpleServer.Examples.ChatClientNetwork.SimpleServer(Network.SimpleServer.Examples.ChatServerrunmainServer ClientConncidlookupmodifyDisconnectHandlerConnectionHandler CmdHandlernew addCommandstartstoprespond broadcast disconnect clientListdoOutputdoInputmaintainConnection printUsageisIntnewConn runServerprocessCommand checkClean acceptConMessagecmdclient UserTableCmdTable TimeStampListportsocketclientscmdList lastcleantimeoutlockcmdTablenextIDcHandlerdHandlerthreadschandlehostpidmsgListdead timestamptidserv safeLookup safeModifycleanfilterM'timedout disconnect'flush readClient writeClient putStrLn' hPutStrLnhGetLinedebugdebugLn' emptyListtakeAllreadAll modifyMVarput$fEqClientConnwelcomeMessageusername connHandler dissHandlernameCmd nameHandlerpingCmd pingHandlermsgCmd msgHandlerdisCmd disHandlerwhoCmd whoHandlerwaitStop