#!/usr/bin/env python
import SocketServer
class MyTCPHandler(SocketServer.BaseRequestHandler):
def handle(self):
print 'Got anew connection from',self.client_address
while True:
data =self.request.recv(1024).strip()
if not data:
print 'Lostconnection with',self.client_address
break
print'recv:',data
#print"{}wrote:".format(self.client_address[0])
#printself.data
self.request.sendall(data.upper())
if __name__ == "__main__":
HOST,PORT="192.168.2.110",99
server =SocketServer.ThreadingTCPServer((HOST,PORT),MyTCPHandler)
server.serve_forever()