import SocketServerimport netstringclass MyRequestHandler(SocketServer.BaseRequestHandler): def handle(self): print "From:", self.client_address while 1: rq = netstring.readns(self.request) print rq netstring.writens(self.request, rq.upper()) if rq.lower() == "end": breakmyServer = SocketServer.TCPServer(('', 8081), MyRequestHandler)myServer.handle_request()
Name (required)
email (will not be published) (required)
Website