class timeserver(streamrequesthandler)def handle(self)resp time ctime("\ \nself wfile write(resp encode('latin- ')if you are writing handler that only operates with packets and always sends response back to the senderhave it inherit from datagramrequesthandler instead of baserequesthandler it provides the same file-like interface as streamrequesthandler for exampletryfrom socketserver import datagramrequesthandler except importerrorfrom socketserver import datagramrequesthandler import time python python class timeserver(datagramrequesthandler)def handle(self)resp time ctime("\ \nself wfile write(resp encode('latin- 'in this caseall of the data written to self wfile is collected into single packet that is returned after the handle(method returns servers to use handlerit has to be plugged into server object there are four basic server classes definedtcpserver(addresshandlera server supporting the tcp protocol using ipv address is tuple of the form (hostporthandler is an instance of subclass of the baserequesthandler class described later udpserver(addresshandlera server supporting the internet udp protocol using ipv address and handler are the same as for tcpserver(unixstreamserver(addresshandlera server implementing stream-oriented protocol using unix domain sockets inherits from tcpserver unixdatagramserver(addresshandlera server implementing datagram protocol using unix domain sockets this inherits from udpserver instances of all four server classes have the following basic methodss fileno(returns the integer file descriptor for the server socket the presence of this method makes it legal to use server instances with polling operations such as the select(function serve_forever(handles an infinite number of requests lib fl ff