Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
(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?$!=$^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);
Thank you very much for any suggestion and insight you may provide!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IO::Socket::INET fails in rare cases on Windows (0+$!)
by tye (Sage) on Jan 30, 2005 at 18:09 UTC | |
|
Re: IO::Socket::INET fails in rare cases on Windows
by BrowserUk (Patriarch) on Jan 30, 2005 at 17:49 UTC | |
by Anonymous Monk on Jan 30, 2005 at 19:41 UTC |