halfcountplus has asked for the wisdom of the Perl Monks concerning the following question:
I added the close() because when the program ends by itself this way (as opposed to being terminated with ^C), the port is evidently left blocked -- when I try to restartmy $server = IO::Socket::INET->new(LocalPort => 666, Type=> SOCK_STREAM, Listen => 0, Proto => "tcp"); die "Can't open socket" if (!$server); [...the main loop...] close($server); log_msg("Connection lost.\n");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: closing socket/port
by Fletch (Bishop) on Aug 14, 2009 at 17:44 UTC | |
by halfcountplus (Hermit) on Aug 15, 2009 at 20:33 UTC | |
|
Re: closing socket/port
by rcaputo (Chaplain) on Aug 14, 2009 at 18:15 UTC | |
by halfcountplus (Hermit) on Aug 15, 2009 at 20:32 UTC |