in reply to Re^4: Handling sockets in a server
in thread Handling sockets in a server
Hopefully someone can answer questions 3 and 4. Here they are again. I didn't copy my example code but it is in the orginial post. Thanks
3. If the child process is executing a command like system("echo Hello");, I need to reap child processes before closing the forked child process so as not to leave "zombies" right? Or is my handling that via capturing the CHLD signal ($SIG{'CHLD'} = 'IGNORE';) before I even start up the socket sufficient? I wasn't sure I needed to do one of these:
while ( my $child_process = waitpid(-1,WNOHANG) > 0 ) { }
before I close the child each time.
4. In Perl 5.6.1, after each accepted connection do I need to reset STDERR and STDOUT that I set prior creating the socket? Previously in Perl 5.005_02 I was having to reset these with each new connection. If that's the same, can someone tell me why?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Handling sockets in a server
by skerr1 (Sexton) on Oct 26, 2005 at 00:24 UTC | |
by skerr1 (Sexton) on Dec 01, 2005 at 04:10 UTC |