develooper Front page | perl.perl5.porters | Postings from January 2005

Re[2]: [perl #33619] IO::Socket::INET.pm bug fix

Thread Next
From:
Chris Drake
Date:
January 4, 2005 10:16
Subject:
Re[2]: [perl #33619] IO::Socket::INET.pm bug fix
Message ID:
255293820.20050104224357@pobox.com
Hi,

The windows fix is different, and works OK too (as per my post to
ActiveState which I sent you a URL to earlier). The fix below is for
Unix.  (I've tested on RHEL3.0, and RedHat 9 only though)
It's documented deep inside the various "C" doc; I don't know why, I
just coded what the ioctl author said had to be done.  Why the
Socket.pm author never bothered to test blocking even though he (half)
coded it in beats me: the fact it didn't work either in Unix or
Windows makes me think nobody ever did a test for this concept, so
it's just sat broken ever since.

Kind Regards,
Chris Drake

Friday, December 31, 2004, 9:46:51 PM, you wrote:

THvR> In article <rt-3.0.11-33619-104814.12.4116838261686@perl.org>,
THvR> 	Chris Drake (via RT) <perlbug-followup@perl.org> writes:
>> +         # these 8 lines contributed by Chris Drake:-
>> +         if(defined $arg->{Blocking}) {
>> +           if($arg->{Blocking}) {
>> +             $sock->blocking($arg->{Blocking})
>> +           } else {
>> +             $sock->blocking(undef);
>> +             my $temp = 1; ioctl($sock, 0x8004667E, \$temp); # Don't let it block us.

THvR> This looks horribly unportable !
THvR> 0x8004667E seems to be windows FIONBIO. Why is it needed beyond the
THvR> turning of of blocking ?

>> +           }
>> +         }
>> + 
>> + 
 




Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About