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:

LANG=C perl writer.pl ; netstat -n | egrep 7070 | wc -l
After a while, writer.pl dies and you'll see something like:
Could not connect - Cannot assign requested address 28248
...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).
Update: After a while, resources become available again and you can re-start writer.pl successfully.

HTH


In reply to Re: IO::Socket disconnects in loop by Perlbotics
in thread IO::Socket disconnects in loop by carlin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.