Clean Exit from Socket/Program

Larry ld at nospam.com
Mon Jul 8 18:57:24 EDT 2002


Hi:

I have a program running where data is being continuously fed into a socket
connection.  It seems when I exit the program (control c from keyboard), I
lose a lot of the data that was in the socket buffer.  I know this is the
wrong way to shut down...but right now, I know no other way.

I am used to VB where when I shut down a program from a form, my unload
event triggers and I can clean up.  I am fairly new to python, and I am not
sure how to trigger a shutdown signal which would then allow my program to
catch up and clean up before exiting.

Can anyone give me some tips on...
1. How to shut down a python program cleanly
2. How to ensure that my socket buffer is empty before closing.

Thanks,
Larry







More information about the Python-list mailing list