self.request.send('Received: {0}'.format(recvdata))


class myApp(SocketServer.TCPServer):

    def __init__(self):
        SocketServer.TCPServer.__init__(self, ('localhost', 5555), myHandler)
print(self.server_address)
try:
    self.serve_forever()
except KeyboardInterrupt:
    print('Got keyboard interrupt, shutting down')
self.shutdown()
if __name__ == '__main__':
    app = myApp()
How to create connection timeout with python SocketServer