New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IO::Socket::INET nonblocking mode fails on Win32 - here is the fix #7132
Comments
From cnd@spamcop.netCreated by cnd@spamcop.netSubject: IO::Socket::INET nonblocking mode fails on Win32 - here is the fix Ignore the "Site configuration information" below. this bug is present in As per the subject - "Blocking" doesn't work under Win32. Specifically, $sockets{$ip}=IO::Socket::INET->new(PeerAddr=>$ip, PeerPort=>$p, (exactly *how* it fails differs between perl versions, but it always In summary - 1. the Win32 "$sock->blocking($arg->{Blocking})" call succeeds, defined $sock->blocking($arg->{Blocking}) 2. You've got to do these 2 things immediately before calling setsockopt($sock, SOL_SOCKET, SO_DONTLINGER, 1); # Dont block on close and 3. The Win32 "connect()" call succeeds, although once again it appears return $sock if(($sock) &&( $arg->{Blocking} == 0 )); # Win32 requires this line If you want to email me - cnd@spamcop.net - the source code of the I fixed the "INET.pm" module - here is an MS-DOS "fc" output showing Comparing files inet583.pm and INET582.PM ***** inet583.pm undef $@; # these 13 lines contributed by Chris Drake:- ***** inet583.pm return _error( undef $@; return $sock if(($sock) &&( $arg->{Blocking} == 0 )); # Win32 requires this line return _error( ***** inet583.pm ***** INET582.PM Here is my test script. It will fail under Win32 until you make the above #!/usr/bin/perl # This file is "block.pl" by Chris Drake. use strict; my %sockets; # if ($sockets{$ip}=IO::Socket::INET->new(PeerAddr=>$ip, PeerPort=>$p, Proto=>$Proto, Type=>$Type, ReuseAddr=>1 ) ) { warn "s='$sockets{$ip}' e=$!"; my($b)=''; my($r,$w,$e); while(1) { ####################################################################### =head2 FirstSocket Connects to every supplied IP address, returning the first one that accepts us. B<Input Paramaters> $Proto # 'tcp' usually (anything else is untested) B<Output> (3 element list of...) open socket glob =cut # Print out debugging info # chomp() on unix doesn't eat "\r"... sub ServerName { Perl Info
|
From andreyborovik@sbcglobal.netHi I did changes in My INET.pm file but when I tried to start I got die message. In Attachment you have my INET.pm file and below #! perl5.8.0 -w my $port=2345; my $server = IO::Socket::INET ->new( tie %ready,'Tie::RefHash'; select->remove($client); } ##handle($socket) deals with all pending requests for $client |
The RT System itself - Status changed from 'new' to 'open' |
From christopher@pobox.comHi Andrey, I can't remember testing my suggestion as a server - only a client: Here is how to run my test program:- perl emailchk.pl doof@hotmail.com -debug It should only take a few seconds, and should connect to all the Can you tell me where you got your test script from? Are there any Global symbol "$line" requires explicit package name at line 110. If I take out the line "use strict;" from your script, then Try using my INET.pm and see if your script works OK then? Kind Regards, Sunday, March 21, 2004, 2:06:34 AM, you wrote: Hi I did changes in My INET.pm file but when I tried to start I got die message. In Attachment you have my INET.pm file and below my $port=2345; my $server = IO::Socket::INET ->new( tie %ready,'Tie::RefHash'; select->remove($client); } ##handle($socket) deals with all pending requests for $client ABvR> Return-Path: <rt-andreyborovik=sbcglobal.net@perl.org> ABvR> This transaction appears to have no content |
From christopher@pobox.comp.s. Here's the expected output from my test script - as you can see, C:\>perl emailchk.pl doof@hotmail.com -debug C:\>cd\perl |
From @bulk88On Tue Feb 24 01:37:22 2004, cnd@spamcop.net wrote:
This ticket sounds similar to recently closed RT #7913. blocking() on Win32 in IO::Socket was implemented in -- |
From @jkeenanOn Wed Nov 27 16:02:55 2013, bulk88 wrote:
Accordingly, marking ticket resolved. |
@jkeenan - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#27044 (status was 'resolved')
Searchable as RT27044$
The text was updated successfully, but these errors were encountered: