I developed a project in Linux, using among the others IO::Socket and Log::Log4perl. All fine. I then tried to put the same code in Windows using ActiveState Perl 5.8.8.817, but with much less luck. In the most weird way.
I saw the following error:
so I said "aha! I'll isolate a little script to show there on PerlMonks!", and I isolated the offending code as follows:2006/07/03 16:19:06 IO::Socket::INET::new(): IO::Socket::INET: No such + file or directory at notifyd.pl line 229
Note that Log::Log4perl->easy_init($DEBUG); is commented here - I'm using die - and ARGH! The code is obviously continuing to offend, but it has another message! Well, in the first shot I was using Log4perl, right? Let's restore it:#!/usr/bin/perl use strict; use warnings; use IO::Socket; use Log::Log4perl qw( :easy ); #Log::Log4perl->easy_init($DEBUG); # NOTE: COMMENTED HERE my %listener_parameters = ( Proto => 'udp', Blocking => 1, ReuseAddr => 1, ); my $listener = new IO::Socket::INET(%listener_parameters) or die "IO::Socket::INET::new(): '$@'"; __END__ C:\Documents and Settings\Administrator\Desktop\mms>perl case.pl IO::Socket::INET::new(): 'IO::Socket::INET: ' at case.pl line 13.
ARARGH! With the only call to easy_init() the error message has changed another time! The errors seem to be kind of consistent: each different version of the script always produces the same error message, but apart from this...#!/usr/bin/perl use strict; use warnings; use IO::Socket; use Log::Log4perl qw( :easy ); Log::Log4perl->easy_init($DEBUG); # RESTORED LINE my %listener_parameters = ( Proto => 'udp', Blocking => 1, ReuseAddr => 1, ); my $listener = new IO::Socket::INET(%listener_parameters) or die "IO::Socket::INET::new(): '$@'"; __END__ C:\Documents and Settings\Administrator\Desktop\mms>perl case.pl IO::Socket::INET::new(): 'IO::Socket::INET: Bad file descriptor' at ca +se.pl line 13.
Please save me from this hell: what's going on?
Update: I'm using the indirect call notation here, but only because I tried all the flavours given the initial message of "No such file or directory". In my actual code I'm using IO::Socket::INET->new(%listener_parameters).
Update 2: I managed to eliminate the errors and get the UDP socket to work by eliminating the Blocking => 1 configuration. This is extremely weird, given the fact that this blocking behaviuour should be the default, and that I included it only for paranoic reasons.
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
In reply to Complete mess with IO::Socket in ActivePerl 5.8.8.817 by polettix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |