So I am trying to make a program that handles communication between GUI and server using socket library. The problem is that GUI can be randomly closed, so server must abandon the connection. But it seems like instead client_socket.send() just waits forever if GUI stops responding.
The code is something like this:
try:
client_socket.send(pickle.dumps('TEST'))
except Exception as E:
print("Exception:", E)
What I want server to do is just wait for, say, .5 second then abandon the connection. I hope someone can help me.
Thank you.