kingkongrevenge has asked for the wisdom of the Perl Monks concerning the following question:
use IO::Socket::UNIX; my $sockfile = "/tmp/testsocket"; if (fork) { my $server_sock = IO::Socket::UNIX->new( Type => SOCK_STREAM, Local => $sockfile, Listen => SOMAXCONN ); my $req = $server_sock->accept; # This loop never exits. # The close done from the client is never detected. while ($req->connected) { print STDERR "connected\n"; } print STDERR "disconnected\n"; } else { sleep 1; my $client = IO::Socket::UNIX->new( Type => SOCK_STREAM, Peer => $sockfile ); close $client; exit; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: server doesn't detect closed sockets?
by Anno (Deacon) on Aug 02, 2007 at 11:26 UTC | |
by kingkongrevenge (Scribe) on Aug 02, 2007 at 13:04 UTC |