[Tutor] seeking help to a problem w/ sockets

tiger12506 keridee at jayco.net
Mon Apr 28 17:53:39 CEST 2008


How is the window being closed? By someone forcing it to close? Or 
terminating the process? If someone is just closing the window you can setup 
an atexit handler that will close the socket before it finishes. However, if 
the process is being terminated, then you will have to use one of the other 
options. If that's the only way you have to close the program then you will 
definitely need a flag of some sort. I've been known to play all sorts of 
tricks. Most nastiest of which includes creating a file in a particular 
directory that the program periodically polls. Don't do this. Use threads. 
Or a non-blocking keypress or something. 


More information about the Tutor mailing list