I have a problem. My script creates listening sockets using IO::Socket::INET, this way:
$!=$^E = ''; my $sk = IO::Socket::INET->new(Proto => "tcp", LocalPort => 9000, LocalAddr => "127.0.0.1", Listen => 5, Reuse => 1); print "unable to create socket: $! : $^E\n" if (!$sk);
(First it of course tries to connect to that port to see whether something is listening on it - if nothing does - it then tries to create listening socket using method above). For one of the script's users it fails on both his PC and laptop, both running WinXP Prof SP2. He said he checked 100 times that no firewall and antivirus sw is enabled (he has Norton AntiVirus and ZoneAlarm - but he pretends that he disabled them for testing). Does anybody knows what can be wrong with Perl or with his box? May be protocol number for "tcp" became unknown to Windows? The code above NEVER was able to created a socket for him on any of his computers. It successfully worked on all computers I can find around (including with Windows). He is using Perl 5.8.3 build 809 downloaded from activestate's site. On his box, some windows C/C++ programs that do the same (i.e. open sockets) work just fine. Because I have to email him a testcase and get a debug log from him, I can't debug the code comfortably.. The code prints the following for him: "unable to create socket: Unknown error : The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for". Did anybody ever see something like this?

Thank you very much for any suggestion and insight you may provide!


In reply to IO::Socket::INET fails in rare cases on Windows by Anonymous Monk

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.