Create handler for socket handler : Socket Error Handle : Network PYTHON examples


PYTHON examples » Network » Socket Error Handle »

 

Create handler for socket handler


 

import SocketServer
port = 8000
class myRequestHandler(SocketServer.StreamRequestHandler):
    def handle(self):
        print "connection from ", self.client_address
        self.wfile.write("data")

srvsocket = SocketServer.TCPServer(("", port), myRequestHandler)
print "The socket is listening to port", port
srvsocket.serve_forever()

   
  



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Network
» Socket Error Handle