import socket
import SocketServer
import time

#server setting
host = socket.gethostbyname('172.20.10.5')
port = 8081

class EchoHandler(SocketServer.StreamRequestHandler):
    def handle(self):
        data = self.request.recv(1024)
        print "date:", time.ctime()
        print "recv data: %s\n" % data
        
        self.request.send(data)
        self.request.close()

server = SocketServer.TCPServer((host, port), EchoHandler)
server.serve_forever()