Hi, I can confirm your observations (SuSE 11.1, perl v5.10.0). Seems that your writer.pl is just too fast and consumes a lot of system resources. When writer.pl dies, netstat -n lists some 26k of TIME_WAIT connections for port 7070. If the client allows the sever some time to recover (I used a select(undef,undef,undef,0.0001); after the $i++ in writer.pl), then there's no problem. Runs, and runs, and runs,....while netstat reports something around 13k TIME_WAIT connections, so a kind of equilibrium has been reached.
Change the die() statement in writer.pl to die "Could not connect - $!\n" unless $socket and run writer.pl without the select(...) delay using:
After a while, writer.pl dies and you'll see something like:LANG=C perl writer.pl ; netstat -n | egrep 7070 | wc -l
...meaning, that there were temporarily too few resources left and netstat reported something around 28k connections (nearly all of them in TIME_WAIT state indicating a proper disconnection plus guard time).Could not connect - Cannot assign requested address 28248
HTH
In reply to Re: IO::Socket disconnects in loop
by Perlbotics
in thread IO::Socket disconnects in loop
by carlin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |