implementing the client application as you can see from this diagramthe server waits for connection from the client when the client connects to the serverthe server waits to receive data from the client at this point the client must wait for data to be sent to it from the server the server then sets up the response data and sends it back to the client the client receives this and prints it out and closes the connection in the meantimethe server has been waiting to see if there is any more data from the clientas the client closes the connection the server knows that the client has finished and returns to waiting for the next connection the socketserver module in the above examplethe server code is more complex than the clientand this is for single threaded serverlife can become much more complicated if the server is expected to be multi-threaded server (that is server that can handle multiple requests from different clients at the same timehoweverthe serversocket module provides more convenientobject-oriented approach to creating server much of the boiler plate code needed in such applications is defined in classeswith the developer only having to provide their own classes or override methods to define the specific functionality required there are five different server classes defined in the socketserver module baseserver is the root of the server class hierarchyit is not really intended to be instantiated and used directly instead it is extended by tcpserver and other classes tcpserver uses tcp/ip sockets to communicate and is probably the most commonly used type of socket server udpserver provides access to datagram sockets unixstreamserver and unixdatagramserver use unix-domain sockets and are only available on unix platforms responsibility for processing request is split between server class and request handler class the server deals with the communication issues (listening on socket and portaccepting connectionsetc and the request handler deals with the request issues (interpreting incoming dataprocessing itsending data back to the clientthis division of responsibility means that in many cases you can simply use one of the existing server classes without any modifications and provide custom request handler class for it to work with the following example defines request handler that is plugged into the tcpserver when it is constructed the request handler defines method handle(that will be expected to handle the request processing