
UDP Client/Server Questions
All - I'm using ActivePerl under Win2k. I wrote a small client and
server using IO::Socket::INET.
Problem is that I can't seem to shut the server down cleanly if the
client goes down first. If the server is shut down first, I catch the
Ctrl-C, break out of the while loop, close the socket, and clean up a
log file that I'm writing.
If the client goes down first, I can't seem to catch the Ctrl-C in the
server, the server goes down, and I don't get to close a log file that
I'm writing.
I've registered a sig handler using sigtrap:
use sigtrap qw(handler my_handler normal-signals error-signals);
while ($quit == 0) {
next unless $sock->recv($msg_in,MAX_MSG_LEN);
print "$msg_in\n";
Quote:
}
# Close log file and other things happen here.
sub my_handler {
++$quit;
Quote:
}
Any suggestions? If this is a Win2k/signal issue, any suggestions on
getting around it?
Thanks for the help,
Mark