socketserver.ThreadingTCPServer

class socketserver.ThreadingTCPServer class socketserver.ThreadingUDPServer These classes are pre-defined using the mix-in classes.

socketserver.UnixDatagramServer

class socketserver.UnixDatagramServer(server_address, RequestHandlerClass, bind_and_activate=True) These more infrequently used classes are similar to the TCP and UDP classes, but use Unix domain sockets; they’re not available on non-Unix platforms. The parameters are the same as for TCPServer.

socketserver.StreamRequestHandler

class socketserver.StreamRequestHandler class socketserver.DatagramRequestHandler These BaseRequestHandler subclasses override the setup() and finish() methods, and provide self.rfile and self.wfile attributes. The self.rfile and self.wfile attributes can be read or written, respectively, to get the request data or return data to the client.

socketserver.ThreadingUDPServer

class socketserver.ThreadingUDPServer These classes are pre-defined using the mix-in classes.

socketserver.BaseServer.socket_type

socket_type The type of socket used by the server; socket.SOCK_STREAM and socket.SOCK_DGRAM are two common values.

socketserver.DatagramRequestHandler

class socketserver.DatagramRequestHandler These BaseRequestHandler subclasses override the setup() and finish() methods, and provide self.rfile and self.wfile attributes. The self.rfile and self.wfile attributes can be read or written, respectively, to get the request data or return data to the client.

socketserver.BaseServer.timeout

timeout Timeout duration, measured in seconds, or None if no timeout is desired. If handle_request() receives no incoming requests within the timeout period, the handle_timeout() method is called.

socketserver.ForkingTCPServer

class socketserver.ForkingTCPServer class socketserver.ForkingUDPServer class socketserver.ThreadingTCPServer class socketserver.ThreadingUDPServer These classes are pre-defined using the mix-in classes.

socketserver.BaseServer.verify_request()

verify_request(request, client_address) Must return a Boolean value; if the value is True, the request will be processed, and if it’s False, the request will be denied. This function can be overridden to implement access controls for a server. The default implementation always returns True.

socketserver.ForkingMixIn

class socketserver.ForkingMixIn class socketserver.ThreadingMixIn Forking and threading versions of each type of server can be created using these mix-in classes. For instance, ThreadingUDPServer is created as follows: class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass The mix-in class comes first, since it overrides a method defined in UDPServer. Setting the various attributes also changes the behavior of the underlying server mechanism.