server socket_type the socket type used by the serversuch as socket sock_stream or socket sock_dgram server timeout timeout period in seconds that the server waits for new request on timeoutthe server calls the handle_timeout(method (described belowand goes back to waiting this timeout is not used to set socket timeout howeverif socket timeout has been setits value is used instead of this value here is an example of how to create server that allows the port number to be reusedfrom socketserver import tcpserver class timeserver(tcpserver)allow_reuse_address true serv timeserver(('', ,timehandlerserv serve_forever(if desiredthe following methods are most useful to extend in classes that inherit from one of the servers if you define any of these methods in your own servermake sure you call the same method in the superclass server activate(method that carries out the listen(operation on the server the server socket is referenced as self socket server bind(method that carries out the bind(operation on the server server handle_error(requestclient_addressmethod that handles uncaught exceptions that occur in handling to get information about the last exceptionuse sys exc_info(or functions in the traceback module server handle_timeout(method that is called when the server timeout occurs by redefining this method and adjusting the timeout settingyou can integrate other processing into the server event loop server verify_request(requestclient_addressredefine this method if you want to verify the connection before any further processing this is what you define if you wanted to implement firewall or perform some other kind of validation finallyaddition server features are available through the use of mixin classes this is how concurrency via threads or processing forking is added the following classes are defined for this purposeforkingmixin mixin class that adds unix process forking to serverallowing it to serve multiple clients the class variable max_children controls the maximum number of child lib fl ff