Exemple #1
0
    def run(self):
        try:
            #server = HTTPServer(('', 8000), MyRequestHandler)
            port = get_svrport()
            
            server = ThreadingUDPServer(('',port),UDPRequestHandler)
            print 'started httpserver...'
            server.serve_forever()

        except KeyboardInterrupt:
            server.socket.close()
Exemple #2
0
    def run(self):
        try:
            #server = HTTPServer(('', 8000), MyRequestHandler)
            port = get_svrport()
            type = get_type()
            if type.lower() == "http":
                server = ThreadingHttpServer(('',port),MyRequestHandler)
            elif type.lower() == "udp":
                server = ThreadingUDPServer(('',port),UDPRequestHandler)
            else:
                #default
                server = ThreadingUDPServer(('',port),UDPRequestHandler)
            print 'started httpserver...'
            server.serve_forever()

        except KeyboardInterrupt:
            server.socket.close()