-
Notifications
You must be signed in to change notification settings - Fork 37
Description
I have a python code of 1000 LOC that I am happy to share.
It uses a client with GUI and a server. Upon user.__button_click(), the client sends a request to the server via socket and prints label text in real time on the program state. The server receives the request and then there is a back-and-forth between server and client, based on the kind of request. The server reacts on a request in the server.__serve_client() routine. The communication is with python socket.socket, .connect() and .listen(1) .
Naturally, I put the following python code around user.__button_click() and server.__serve_client() from above:
def run_function_with_timelimit(function,arguments,max_wait,default_value):
try: return func_timeout.func_timeout(max_wait,function,args=arguments)
except func_timeout.FunctionTimedOut: print("took too long")
except Exception as e: print(f"error occured: {e}.")
return default_value
Now nothing works anymore. Particularly, both the server and client repeatedly wait for 10 seconds and then print "took too long".
If you want to help me, point me to where I shall send you my code. Alternatively, I am happy for any instructions in this place on how to fix the error.