Just another Perl shrine | |
PerlMonks |
Re: MP3 server with IO::Socketby ryan (Pilgrim) |
on Jan 07, 2002 at 12:13 UTC ( [id://136797]=note: print w/replies, xml ) | Need Help?? |
Child reaping update: After yet more experimentation with this fabulously educational node I did what was necessary to make it run via init.d based on this node. I soon discovered that when a client was streaming and the parent was killed via the init.d script, the child serving the active client remained running and required manual killing. To fix this problem I kept track of the children in the code and provided a clean-up routine when the script received a TERM signal. Below I list the $SIG{"TERM"} code to catch the TERM signal and 2 extra lines inside the main while loop to track the children as marked between the # >> tags: I'm not a great Perl programmer, but this works flawlessly on my Debian system and has provided my an exceptional motivational tool to start learning socket programming. I hope I havne't overlooked too much error checking or done anything dangerous with my reaping and this can be of some use to someone. Thanks again.
In Section
Tutorials
|
|