The scenario is you have a standard C program that opens sockets. The sockets are used in an infinite loop that never exits. How do you close these sockets immediately on premature exit? There is C atexit(), but the problem is that no arguments can be passed to that. I don't have the integers that refer to the open sockets. The process has the sockets, but how do I access them to close them? One thought is to make the integers global that point to the sockets in question, then they are available at exit... but generally speaking, the use of global variables is
a very bad practice.
_______________________________________________
PLUG mailing list
PLUG@pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to