in reply to fin ack problems with IO::Socket

I'm not very experienced in socket programming, so I'm on a limb here. Whenever I did do socket programming, I either always used close() on the socket when I was done, or just let the socket go out of scope (letting Perl handle all the intricacies automagically). In your case, the out of scoping could be done by changing this:
shutdown ($sock[$count2], 2); print "Closed $sock[$count2]\n";
to:
print "Closed $sock[$count2]\n"; $sock[$count2] = undef;
Hope this helps.

Liz

Replies are listed 'Best First'.
Re: Re: fin ack problems with IO::Socket
by djbiv (Scribe) on Aug 22, 2003 at 12:11 UTC
    Thanks Liz, but no luck. I've tried these different ways to 'close' the socket connection but none of them seem to completely tear the connection down...
    shutdown ($sock[$count2], 2); # no more I/O at all shutdown ($sock[$count2], 1); # no more writing shutdown ($sock[$count2], 0); # no more reading close ($sock[$count2]);