in reply to Re^5: Non closing sockets - threads
in thread Non closing sockets - threads
If one end simply stops sending packets (including closing its end without sending a 'FIN') the other end will wait pretty much indefinitely. (I have tried this with a server running on Linux and Windows XP -- Perl 5.10.0.)
Could tell me how, on XP, you can drop the connection between this server:
#! perl -slw use strict; use IO::Socket; my $server = new IO::Socket::INET( Timeout => 500, Proto => "tcp", LocalPort => 54321, Reuse => 1, Listen => 5 ) or die $^E; my $client = $server->accept; print while <$client>; print "client went away";
and this client:
#! perl -slw use strict; use IO::Socket; my $con = IO::Socket::INET->new( 'localhost:54321' ); print $con "ping" while sleep 1; print "client ended";
Without the server noticing?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Non closing sockets - threads
by gone2015 (Deacon) on Dec 16, 2008 at 23:40 UTC |