Echoãµã¼ã/ã¯ã©ã¤ã¢ã³ããéãã¦ãµã¼ãããã°ã©ãã³ã°ã極ãã 1connection Server from SocketServer import * RECV_BUF = 8192 class Handler(BaseRequestHandler): def handle(self): print "connect from:", self.client_address while True: ret = self.request.recv(RECV_BUF) if len(ret) == 0: break self.request.send(ret) self.request.close() def main(): sv = TCPServer(('', 7070), Handler) print 'listen to:', sv.socket.getsockname() sv.
{{#tags}}- {{label}}
{{/tags}}