You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class ThreadingTCPServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer):
pass
class RequestHandler(SocketServer.StreamRequestHandler):
@timeout_decorator.timeout(seconds=5, use_signals=False)
def handle(self):
#do some time-consuming stuff
if __name__ == '__main__':
server = ThreadingTCPServer((server_ip, server_port), RequestHandler)
server.serve_forever()
When I run the server and a client sending requests to the server, I get the following error:
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/lib/python2.7/SocketServer.py", line 599, in process_request_thread
self.handle_error(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 596, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 331, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 652, in __init__
self.handle()
File "/usr/local/lib/python2.7/dist-packages/timeout_decorator/timeout_decorator.py", line 132, in __call__
return self.value
File "/usr/local/lib/python2.7/dist-packages/timeout_decorator/timeout_decorator.py", line 154, in value
raise load
TypeError: handle() takes exactly 1 argument (0 given)
Is there something wrong with my code?
The text was updated successfully, but these errors were encountered:
I've got a server using ThreadingMixIn:
When I run the server and a client sending requests to the server, I get the following error:
Is there something wrong with my code?
The text was updated successfully, but these errors were encountered: