Great Monks, I am stuck on a problem with the IO::Socket module and a simple piece of code. Here is the background... I am using a script to open 100 socket connections on one port, after I open the sockets I want to be able to close a few of them and open a few more, etc... running this on Active state 5.8 and 5.05... for AIX and neither the close or shutdown calls on the socket seem to be completely tearing the socket down? when I have closed down 5 sockets and run a netstat on my port the status is set to CLOSE_WAIT. a 'friend' w/ root access that ran an iptrace for me told me that my client isn't sending the final FIN ACK...? I looked in perldoc IO::Socket and perldoc Socket and didn't see any clues into the low level TCP protocal. Any ideas of where to go from here would be much appreciated!
my $count = 0; my @sock; while ($count < 100) { $sock[$count] = IO::Socket::INET->new(PeerAddr => $args{h}, PeerPort => $args{p}, Proto => 'tcp', Type => SOCK_STREAM, Timeout => 10); print "\nCONNECTED TO HOST:$args{h} PORT:$args{p} $count times \n" +; $count++; } sleep 10; my $count2; while ($count2 < 5) { shutdown ($sock[$count2], 2); print "Closed $sock[$count2]\n"; $count2++; } sleep 15; }

In reply to fin ack problems with IO::Socket by djbiv

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.