SocketServer

The SocketServer module is used to write TCP, UDP, and UNIX domain socket servers. Rather than having to implement servers using the low-level socket module, this module provides four classes that implement these protocols:

						TCPServer(address, handler)

A server supporting the TCP protocol using IPv4. address is a tuple of the form (host, port). handler is an instance of a subclass of the BaseRequestHandler class described later.

						UDPServer(address, handler)

A server supporting the Internet UDP protocol using IPv4. address and handler are the same as for TCPServer().

						UnixStreamServer(address, handler)

A server implementing a stream-oriented protocol using UNIX domain sockets. Inherits from TCPServer.

						UnixDatagramServer(address, ...

Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.