On Suday the 11th of February, 2007 -after 3 and a half years on InvisionFree, we have moved! This old board remains as a read only archive of years past, and registration has been disabled here. All new and current members should register at http://www.cpplc.net/forum .
| · Portal |
Help
Search
Members
Calendar
|
| Welcome Guest ( Log In | Register ) | Resend Validation Email |
![]() ![]() ![]() |
| icon0x |
Posted: Jan 29 2007, 07:02 PM
|
||||
![]() KERNEL PANIC! Group: Members Posts: 87 Member No.: 1,662 Joined: 31-January 06 |
issue, when closing the client, the server leaves behind zombies, shouldnt waitpid take care of this problem? //server
//client
-------------------- ![]() ![]() |
||||
| myork |
Posted: Jan 30 2007, 03:36 PM
|
||||||||
|
c++ guru Group: Super Moderator Posts: 2,584 Member No.: 487 Joined: 21-January 04 |
There is no point doing a 'waitpid()' inside the signal handler as the process is already dead. Use this if you want the parent to suspend and wait for a child to die. It is probably not a good idea to use 'waitpid()' inside a signal handler (but read documentation about that). Since the 'waitpid()' is in a signal handler it will not get executed in the normal flow of the code. Each child process is sitting inside a loop
This condition will only be false when the socket is closed. This will happen when the client dies or explicitly coses the connection (assuming it was all set up correctly with no errors). The client on the other hand is sitting inside a loop
so he will never die (unless the attached child closes the socket [which it will not]).
So both processes are stuck waiting for each other. |
||||||||
![]() |
![]() ![]() ![]() |