May-01-2018, 08:17 PM
(This post was last modified: May-01-2018, 08:17 PM by ThiefOfTime.)
One way you could try is to send one last message to the server saying that the client is now logged off. if you are running a console application catch the keyboard interrupt.
The best way to clean up in this scenario would be to have a timer running on the server that closes everything after some amount of time.
The best way to clean up in this scenario would be to have a timer running on the server that closes everything after some amount of time.
from time import time start = time() # some communication stuff end = time() if end - start >= time_threshold: # close server or reset servermake sure this only happens after a client connected to the server :)