Skip to content
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

Closed
p5pRT opened this issue Feb 24, 2004 · 11 comments
Closed

IO::Socket::INET nonblocking mode fails on Win32 - here is the fix #7132

p5pRT opened this issue Feb 24, 2004 · 11 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 24, 2004

Migrated from rt.perl.org#27044 (status was 'resolved')

Searchable as RT27044$

@p5pRT
Copy link
Author

p5pRT commented Feb 24, 2004

From cnd@spamcop.net

Created by cnd@spamcop.net

Subject​: IO​::Socket​::INET nonblocking mode fails on Win32 - here is the fix

Ignore the "Site configuration information" below. this bug is present in
all IO​::Socket​::INET distributions up to and including 5.8.3

As per the subject - "Blocking" doesn't work under Win32. Specifically,
this call fails​:-

$sockets{$ip}=IO​::Socket​::INET->new(PeerAddr=>$ip, PeerPort=>$p,
  Proto=>$Proto, Type=>$Type, ReuseAddr=>1, Blocking=>0)

(exactly *how* it fails differs between perl versions, but it always
fails)

In summary -

1. the Win32 "$sock->blocking($arg->{Blocking})" call succeeds,
  despite the fact that it appears to come back with an error code
  under Win32. So this line, although it actually works fine,
  wrongly stops the show​:-

  defined $sock->blocking($arg->{Blocking})
  or return _error($sock, $!, "$!");

2. You've got to do these 2 things immediately before calling
  connect() otherwise it will block anyway (despite the above)

  setsockopt($sock, SOL_SOCKET, SO_DONTLINGER, 1); # Dont block on close

  and
 
  my $temp = 1; ioctl($sock, 0x8004667E, \$temp); # Don't let it block us.

3. The Win32 "connect()" call succeeds, although once again it appears
  to come back with an error code, so the show gets stopped wrongly
  again, unless you add this line after it (to return the correctly
  connected socket handle)​:

  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
most recent INET.pm you've got lying around, I'll fix and test it
under Win32 and Linux and send it back.
 
Below is a test script.

I fixed the "INET.pm" module - here is an MS-DOS "fc" output showing
what you need to alter to make non-blocking work. "inet583.pm" is
your original file. "INET582.PM" is my fixed version.

Comparing files inet583.pm and INET582.PM
***** inet583.pm
  if (defined $arg->{Blocking}) {
  defined $sock->blocking($arg->{Blocking})
  or return _error($sock, $!, "$!");
  }
***** INET582.PM
  if (defined $arg->{Blocking}) {
  # defined $sock->blocking($arg->{Blocking}) # <-- this line always "fails" on Win32
  $sock->blocking(0) if($arg->{Blocking}==0); # Blocking=>1 is already the default anyhow.
  }
*****

***** inet583.pm

  undef $@​;
  if ($sock->connect(pack_sockaddr_in($rport, $raddr))) {
# ${*$sock}{'io_socket_timeout'} = $timeout;
  return $sock;
  }
***** INET582.PM

  # these 13 lines contributed by Chris Drake​:-
  if(defined $arg->{Blocking}) {
  if($arg->{Blocking}) {
  $sock->blocking($arg->{Blocking})
  } else {
  if($^O =~/Win32/i) {
  setsockopt($sock, SOL_SOCKET, SO_DONTLINGER, 1); # Dont block on close
  } else {
  $sock->blocking(0);
  }
  my $temp = 1; ioctl($sock, 0x8004667E, \$temp); # Don't let it block us.
  }
  }
*****

***** inet583.pm

  return _error($sock, $!, $@​ || "Timeout")
***** INET582.PM

  undef $@​;
  if ($sock->connect(pack_sockaddr_in($rport, $raddr))) {
# ${*$sock}{'io_socket_timeout'} = $timeout;
  return $sock;
  }

  return $sock if(($sock) &&( $arg->{Blocking} == 0 )); # Win32 requires this line

  return _error($sock, $!, $@​ || "Timeout")
*****

***** inet583.pm

***** INET582.PM
*****

Here is my test script. It will fail under Win32 until you make the above
corrections, and then it will work nicely.

#!/usr/bin/perl

# This file is "block.pl" by Chris Drake.

use strict;
use bytes;
use Time​::HiRes qw(time);
use IO​::Socket; # For the server

my %sockets;
# my $ip="203.2.192.76";
my $ip="65.54.190.230"; # This is a hotmail mail server - change to some other IP to experiment with blocking
my $p=25;
my $Proto='tcp';
my $Type=SOCK_STREAM;
my $Timeout=3;

# if ($sockets{$ip}=IO​::Socket​::INET->new(PeerAddr=>$ip, PeerPort=>$p, Proto=>$Proto, Type=>$Type, ReuseAddr=>1 ) ) {
if ($sockets{$ip}=IO​::Socket​::INET->new(PeerAddr=>$ip, PeerPort=>$p, Proto=>$Proto, Type=>$Type, ReuseAddr=>1, Blocking=>0) ) {
  warn "yes";
} else {
  warn "no";
}

warn "s='$sockets{$ip}' e=$!";

my($b)='';
vec($b,fileno($sockets{$ip}),1)=1;

my($r,$w,$e);

while(1) {
  my $n=select($r=$b,$w=$b,$e=$b,$Timeout);
  my $rp=unpack("B*",$r);
  my $wp=unpack("B*",$w);
  my $ep=unpack("B*",$e);
  print "n=$n r=$rp w=$wp e=$ep\n";
  if(vec($r,fileno($sockets{$ip}),1)==1) {
  my $buff;
  sysread($sockets{$ip},$buff,16384);
  print "buff​:-\n$buff\n";
  close($sockets{$ip});
  exit(0);
  }
}

#######################################################################

=head2 FirstSocket

Connects to every supplied IP address, returning the first one that accepts us.
you cn use 'ip​:port' in the list - if no :port, uses $PeerPort by default.

B<Input Paramaters>

  $Proto # 'tcp' usually (anything else is untested)
  $Type # SOCK_STREAM usually (anything else is untested)
  $Timeout # max number of seconds to wait before giving up on them all
  $PeerPort # default port (used if not specified in the list)
  @​ips # list of IP addresses to try. (see ValidEmail(,2));

B<Output> (3 element list of...)

  open socket glob
  ip address we used
  first 16k of data read from the open socket

=cut
#######################################################################
sub FirstSocket {
  my($Proto,$Type,$Timeout,$PeerPort,@​ips)=@​_;
  undef %sockets; my($now)=time; my($some,$bits_server,$null_server,$r,$w,$e)=(0,'','');
  # my(%switch); #=('debug' => 1);
  my(%switch)=('debug' => 1);
  foreach my $ipp (@​ips) {
  my($ip,$p)=split('​:',$ipp,2); $p=$PeerPort unless($p);
  #NB​: Blocking=>0 fails unless the latest/fixed IO/Socket/INET.pm is loaded ()​: this must be inside their while(1) loop​:-
  # defined $sock->blocking($arg->{Blocking}) (see) http​://search.cpan.org/src/NWCLARK/perl-5.8.3/ext/IO/lib/IO/Socket/INET.pm
  $sockets{$ip}=IO​::Socket​::INET->new(PeerAddr=>$ip, PeerPort=>$p, Proto=>$Proto, Type=>$Type, ReuseAddr=>1, Blocking=>0);
  &write_log("FirstSocket trying $ip") if($switch{'debug'});
  $some++;
  }
  while(($some)&&((time-$now)<=$Timeout)) {
  $bits_server='';
  foreach my $ip (keys %sockets) {
  vec($bits_server,fileno($sockets{$ip}),1)=1 if($sockets{$ip});
  }
  #if(select($r=$bits_server,$w=$bits_server,$e=$bits_server,$Timeout)) { # Wait for read to be allowed}
  if(select($r=$bits_server,undef,$e=$bits_server,$Timeout)) { # Wait for read to be allowed
  foreach my $ip (keys %sockets) {
  if($sockets{$ip}) {
  if(vec($e,fileno($sockets{$ip}),1)) { # Error
  close($sockets{$ip});undef $sockets{$ip};$some--;
  &write_log("FirstSocket connect error​: $ip") if($switch{'debug'});
  } elsif(vec($r,fileno($sockets{$ip}),1)) { # Reading is OK
  my($buff); recv($sockets{$ip}, $buff, 16384, 0); # Read upto 16K
  if(length($buff)==0) { # Error
  close($sockets{$ip});undef $sockets{$ip};$some--;
  &write_log("FirstSocket read error​: $ip") if($switch{'debug'});
  } else { # Great - got one!
  foreach my $ip2 (keys %sockets) {
  close($sockets{$ip2}) if(($sockets{$ip2})&&($ip ne $ip2));# Close all the others
  }
  &write_log("FirstSocket success​: $ip") if($switch{'debug'});
  return ($sockets{$ip},$ip,$buff);
  }
  }
  }
  }
  &write_log("Waiting on $some ...") if($switch{'debug'});
  }
  }
  &write_log("FirstSocket nothing worked in ". (time-$now) ." seconds") if($switch{'debug'});
  return(undef,undef,undef);
}

# Print out debugging info
sub write_log {
  my($message)=@​_;
  my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
  my($date)=sprintf("%02d/%02d %02d​:%02d.%02d",$mon+1,$mday,$hour,$min,$sec);
  print "$date $$ emailcheck.pl $message\n";
}

# chomp() on unix doesn't eat "\r"...
sub chompnl {
  chop $_[0] while((substr($_[0],-1) eq "\015")||(substr($_[0],-1) eq "\012"));
}

sub ServerName {
  return "hotmail.com";
}

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl v5.6.1:

Configured by ActiveState at Mon Jun 17 21:32:50 2002.

Summary of my perl5 (revision 5 version 6 subversion 1) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=undef use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cl', ccflags ='-nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_MSVCRT_READFIX',
    optimize='-O1 -MD -DNDEBUG',
    cppflags='-DWIN32'
    ccversion='', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -release  -libpath:"C:/Perl\lib\CORE"  -machine:x86'
    libpth="C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Lib\" "C:\Perl\lib\CORE"
    libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
    perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl56.lib
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release  -libpath:"C:/Perl\lib\CORE"  -machine:x86'

Locally applied patches:
    ACTIVEPERL_LOCAL_PATCHES_ENTRY


@INC for perl v5.6.1:
    C:/Perl/lib
    C:/Perl/site/lib
    .


Environment for perl v5.6.1:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\SecureCRT\;C:\DOS;C:\WINDOWS\ORANT\bin;C:\PROGRA~1\COMMON~1\MGISHA~1\Video;C:\PROGRA~1\COMMON~1\MGISHA~1\SHARED~1\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin
    PERLDB_OPTS=RemotePort=127.0.0.1:2000
    PERL_BADLANG (unset)
    SHELL (unset)


@p5pRT
Copy link
Author

p5pRT commented Mar 20, 2004

From andreyborovik@sbcglobal.net

Hi I did changes in My INET.pm file but when I tried to start I got die message.
"Couldn't be a tcp server on port server_port​:$port\n";
I very appreciate you if you help me.
Regards Andrey Borovik

In Attachment you have my INET.pm file and below
my source

#! perl5.8.0 -w
use POSIX;
use IO​::Socket;
use IO​::Select;
use Socket;
use Tie​::RefHash;
use strict;

my $port=2345;
my $Type=SOCK_STREAM;

my $server = IO​::Socket​::INET ->new(
# Listen=>10,
Type=>$Type,
ReuseAddr=>1,
LocalPort=>$port,
Proto=>'tcp'
,Blocking=>0
)
or die "Couldn't be a tcp server on port server_port​:$port\n";
my %inbuffer=();
my %outbuffer=();
my %ready =();

tie %ready,'Tie​::RefHash';
my $select=IO​::Select->new($server);
while (1){
my $client;
my $rv;
my $data="";
foreach $client ($select->can_read(1)) {
if ( $client==$server){
#accept new connection
$client=$server->accept();
my $h=$select->handles();
$select->add($client);
$h=$select->handles();
}else{
#read data
$data='1';
$rv =$client->recv($data,POSIX​::BUFSIZ,50);
unless (defined($rv) && length $data) {
#this would be the end of file , so slose the client
delete $inbuffer{$client};
delete $outbuffer{$client};
delete $ready{$client};
$select->remove($client);
close $client;
next;
}
$inbuffer{$client}.=$data;
#test whether the data in the buffer or the data we just read
#means there is a complete request waiting to be fulilled.
#If there is , set $ready{$client} to the requests waiting to be fulfilled
while ($inbuffer{$client}=~s/(.*\n)//) {
push (@​{$ready{$client}},$1);
}
# push (@​{$ready{$client}},$1);
}
}
#Any complete requests to process?
foreach $client (keys %ready){
handle($client);
}
#Buffers to flush?
foreach $client ($select->can_write(50)) {
#Skip this client if we have nothing to say
next unless exists $outbuffer{$client};
$outbuffer{$client}="hello";
$rv=$client->send($outbuffer{$client},0);
unless (defined $rv){
#Whine, but move on
warn "I was told I could write, but I can't.\n";
next;
}
if ($rv == length $outbuffer{$client}){
#||{! ==POSIX​::EWOULDBLOCK) {
substr($outbuffer{$client},0,$rv)='';
delete $outbuffer{$client} unless length $outbuffer{$client};
}else {
#Couldn't write all the data , and it wasn't because it would have blocked.
print "Shut down and move on\n";
delete $inbuffer{$client};
delete $outbuffer{$client};
delete $ready{$client};

select->remove($client);
next;
}

}
#Out of band data?
#foreach $client ($select->has_exception(0)) {#arg is timeout #Deal with out-of-band here, if you want to }
#print "end of step in while\n";
}

##handle($socket) deals with all pending requests for $client
sub handle{
#requests are in $ready{$client}
#send output to $outbuffer{$client}
my $client=shift;
my $request;
foreach $request (@​{$ready{$client}}) {
print "Inside handle\n";
#$request is the text of the request
# put text of reply into $outbuffer{$client}
#my $side="South";
#my $hand = send_hand($side);
$outbuffer{$client}=$line;
}
delete $ready{$client};
}

@p5pRT
Copy link
Author

p5pRT commented Mar 20, 2004

@p5pRT
Copy link
Author

p5pRT commented Mar 20, 2004

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Mar 22, 2004

From christopher@pobox.com

Hi Andrey,

I can't remember testing my suggestion as a server - only a client​:
but it should still work OK? I've attached my own INET.pm for you to
try out. I've also attached a working program I wrote which makes use
of non-blocking IO (it's an anti-spam filter that checks for bogus
email addresses).

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
servers it lists instantly. See below for the output you can expect.

Can you tell me where you got your test script from? Are there any
other parts that should go with it (a client maybe)? Are you using
Windows, and which perl port are you using? The file you sent to me
does not work - I get this​:-

Global symbol "$line" requires explicit package name at line 110.

If I take out the line "use strict;" from your script, then
your test program works fine on my modified and working perl 5.8
... except for the same error from above​:-
  Name "main​::line" used only once​: possible typo at line 109.

Try using my INET.pm and see if your script works OK then?

Kind Regards,
Chris Drake


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.
"Couldn't be a tcp server on port server_port​:$port\n";
I very appreciate you if you help me.
Regards Andrey Borovik

In Attachment you have my INET.pm file and below
my source
#! perl5.8.0 -w
use POSIX;
use IO​::Socket;
use IO​::Select;
use Socket;
use Tie​::RefHash;
use strict;

my $port=2345;
my $Type=SOCK_STREAM;

my $server = IO​::Socket​::INET ->new(
# Listen=>10,
Type=>$Type,
ReuseAddr=>1,
LocalPort=>$port,
Proto=>'tcp'
,Blocking=>0
)
or die "Couldn't be a tcp server on port server_port​:$port\n";
my %inbuffer=();
my %outbuffer=();
my %ready =();

tie %ready,'Tie​::RefHash';
my $select=IO​::Select->new($server);
while (1){
my $client;
my $rv;
my $data="";
foreach $client ($select->can_read(1)) {
if ( $client==$server){
#accept new connection
$client=$server->accept();
my $h=$select->handles();
$select->add($client);
$h=$select->handles();
}else{
#read data
$data='1';
$rv =$client->recv($data,POSIX​::BUFSIZ,50);
unless (defined($rv) && length $data) {
#this would be the end of file , so slose the client
delete $inbuffer{$client};
delete $outbuffer{$client};
delete $ready{$client};
$select->remove($client);
close $client;
next;
}
$inbuffer{$client}.=$data;
#test whether the data in the buffer or the data we just read
#means there is a complete request waiting to be fulilled.
#If there is , set $ready{$client} to the requests waiting to be fulfilled
while ($inbuffer{$client}=~s/(.*\n)//) {
push (@​{$ready{$client}},$1);
}
# push (@​{$ready{$client}},$1);
}
}
#Any complete requests to process?
foreach $client (keys %ready){
handle($client);
}
#Buffers to flush?
foreach $client ($select->can_write(50)) {
#Skip this client if we have nothing to say
next unless exists $outbuffer{$client};
$outbuffer{$client}="hello";
$rv=$client->send($outbuffer{$client},0);
unless (defined $rv){
#Whine, but move on
warn "I was told I could write, but I can't.\n";
next;
}
if ($rv == length $outbuffer{$client}){
#||{! ==POSIX​::EWOULDBLOCK) {
substr($outbuffer{$client},0,$rv)='';
delete $outbuffer{$client} unless length $outbuffer{$client};
}else {
#Couldn't write all the data , and it wasn't because it would have blocked.
print "Shut down and move on\n";
delete $inbuffer{$client};
delete $outbuffer{$client};
delete $ready{$client};

select->remove($client);
next;
}

}
#Out of band data?
#foreach $client ($select->has_exception(0)) {#arg is timeout #Deal with out-of-band here, if you want to }
#print "end of step in while\n";
}

##handle($socket) deals with all pending requests for $client
sub handle{
#requests are in $ready{$client}
#send output to $outbuffer{$client}
my $client=shift;
my $request;
foreach $request (@​{$ready{$client}}) {
print "Inside handle\n";
#$request is the text of the request
# put text of reply into $outbuffer{$client}
#my $side="South";
#my $hand = send_hand($side);
$outbuffer{$client}=$line;
}
delete $ready{$client};
}

ABvR> Return-Path​: <rt-andreyborovik=sbcglobal.net@​perl.org>
ABvR> Received​: from c60.cesmail.net (c60.cesmail.net [216.154.195.49])
ABvR> by window.geek.net.au (8.12.8/8.12.8) with ESMTP id i2KF6GH4016298
ABvR> for <cnd@​geek.net.au>; Sat, 20 Mar 2004 15​:06​:19 GMT
ABvR> Received​: from unknown (HELO blade1.cesmail.net) (192.168.1.211)
ABvR> by c60.cesmail.net with SMTP; 20 Mar 2004 10​:06​:37 -0500
ABvR> Received​: (qmail 21185 invoked by uid 1010); 20 Mar 2004 15​:06​:36 -0000
ABvR> Delivered-To​: spamcop-net-cnd@​spamcop.net
ABvR> Received​: (qmail 21168 invoked from network); 20 Mar 2004 15​:06​:35 -0000
ABvR> Received​: from unknown (HELO mailgate.cesmail.net) (192.168.1.101)
ABvR> by blade1.cesmail.net with SMTP; 20 Mar 2004 15​:06​:35 -0000
ABvR> Received​: (qmail 5217 invoked from network); 20 Mar 2004 15​:06​:35 -0000
ABvR> Received​: from x1.develooper.com (63.251.223.170)
ABvR> by mailgate.cesmail.net with SMTP; 20 Mar 2004 15​:06​:35 -0000
ABvR> Received​: (qmail 22224 invoked by uid 405); 20 Mar 2004 15​:06​:34 -0000
ABvR> Date​: 20 Mar 2004 15​:06​:34 -0000
ABvR> Subject​: [perl #27044] IO​::Socket​::INET nonblocking mode fails on Win32 - here is the fix
ABvR> From​: "Andrey Borovik via RT" <perlbug-followup@​perl.org>
ABvR> Reply-To​: perlbug-followup@​perl.org
ABvR> In-Reply-To​: <rt-27044@​perl>
ABvR> Message-ID​: <rt-3.0.8-27044-82380.7.14659352648951@​perl.org>
ABvR> Precedence​: bulk
ABvR> X-RT-Loop-Prevention​: perl
ABvR> RT-Ticket​: perl #27044
ABvR> Managed-by​: RT 3.0.8 (http​://www.bestpractical.com/rt/)
ABvR> RT-Originator​: andreyborovik@​sbcglobal.net
ABvR> To​: cnd@​spamcop.net
ABvR> MIME-Version​: 1.0
ABvR> X-RT-Original-Encoding​: utf-8
ABvR> Content-type​: multipart/mixed; boundary="----------=_1079795193-25107-1"
ABvR> X-Spam-Checker-Version​: SpamAssassin 2.63 (2004-01-11) on blade1
ABvR> X-Spam-Level​:
ABvR> X-Spam-Status​: hits=0.0 tests=HTML_MESSAGE version=2.63
ABvR> X-SpamCop-Checked​: 192.168.1.101 63.251.223.170
ABvR> Status​:

ABvR> This transaction appears to have no content

@p5pRT
Copy link
Author

p5pRT commented Mar 22, 2004

From christopher@pobox.com

emailchk.pl

@p5pRT
Copy link
Author

p5pRT commented Mar 22, 2004

From christopher@pobox.com

INET.pm

@p5pRT
Copy link
Author

p5pRT commented Mar 22, 2004

From christopher@pobox.com

p.s. Here's the expected output from my test script - as you can see,
it "connects" to all 10 hotmail mail servers in under 1 second, which
is the correct output - if it takes a long time to connect to them
all, or fails, then your INET.pm is no good still)​:-

C​:\>perl emailchk.pl doof@​hotmail.com -debug
03/20 16​:35.49 6704 emailcheck.pl Invoked With doof@​hotmail.com^-debug - Switche
s​: ProgName='emailchk.pl' WinDir='C​:\WINDOWS' WinDrive='C​:' ProgramFiles='C​:\Pro
gram Files' 1='doof@​hotmail.com' TmpDir='C​:\DOCUME1\!\LOCALS1\Temp' 0='emailch
k.pl' debug='1' DirSep='\' DocSettings='C​:\Documents and Settings'
03/20 16​:35.49 6704 emailcheck.pl Parse in​:doof@​hotmail.com
03/20 16​:35.49 6704 emailcheck.pl Parse out​:doof@​hotmail.com^doof@​hotmail.com^
03/20 16​:35.49 6704 emailcheck.pl resolving... mx4.hotmail.com
03/20 16​:35.49 6704 emailcheck.pl resolving... mx1.hotmail.com
03/20 16​:35.49 6704 emailcheck.pl resolving... mx2.hotmail.com
03/20 16​:35.49 6704 emailcheck.pl resolving... mx3.hotmail.com
03/20 16​:35.49 6704 emailcheck.pl 65.54.253.230^65.54.167.230^65.54.190.230^64.4
.50.99^65.54.252.99^65.54.190.7^65.54.166.230^65.54.167.5^65.54.253.99^64.4.50.2
39
03/20 16​:35.49 6704 emailcheck.pl FirstSocket trying 65.54.252.99
03/20 16​:35.49 6704 emailcheck.pl FirstSocket trying 65.54.190.7
03/20 16​:35.50 6704 emailcheck.pl FirstSocket trying 65.54.190.230
03/20 16​:35.50 6704 emailcheck.pl FirstSocket trying 65.54.253.99
03/20 16​:35.50 6704 emailcheck.pl FirstSocket trying 64.4.50.99
03/20 16​:35.50 6704 emailcheck.pl FirstSocket trying 65.54.253.230
03/20 16​:35.50 6704 emailcheck.pl FirstSocket trying 64.4.50.239
03/20 16​:35.50 6704 emailcheck.pl FirstSocket trying 65.54.167.5
03/20 16​:35.50 6704 emailcheck.pl FirstSocket trying 65.54.167.230
03/20 16​:35.50 6704 emailcheck.pl FirstSocket trying 65.54.166.230
03/20 16​:35.50 6704 emailcheck.pl FirstSocket success​: 65.54.190.230
03/20 16​:35.50 6704 emailcheck.pl Testing connected socket 65.54.190.230​:25
03/20 16​:35.51 6704 emailcheck.pl TestSmtp(65.54.190.230,25,pr@​ugeek.com,doof@​ho
tmail.com,1,15,13)=(1,got upto DATA ok)
rc=3
msg=got upto DATA ok

C​:\>cd\perl

@p5pRT
Copy link
Author

p5pRT commented Nov 28, 2013

From @bulk88

On Tue Feb 24 01​:37​:22 2004, cnd@​spamcop.net wrote​:

This is a bug report for perl from cnd@​spamcop.net,
generated with the help of perlbug 1.33 running under perl v5.6.1.

-----------------------------------------------------------------
[Please enter your report here]

Subject​: IO​::Socket​::INET nonblocking mode fails on Win32 - here is
the fix

This ticket sounds similar to recently closed RT #7913. blocking() on Win32 in IO​::Socket was implemented in
http​://perl5.git.perl.org/perl.git/commitdiff/2f78ce11bc4a9355ade5d20a0825b10fbb177169 in 5.9.4 in 2006. The OP was using 5.6.1 in 2004. I recommend close.

--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented Nov 28, 2013

From @jkeenan

On Wed Nov 27 16​:02​:55 2013, bulk88 wrote​:

On Tue Feb 24 01​:37​:22 2004, cnd@​spamcop.net wrote​:

This is a bug report for perl from cnd@​spamcop.net,
generated with the help of perlbug 1.33 running under perl v5.6.1.

-----------------------------------------------------------------
[Please enter your report here]

Subject​: IO​::Socket​::INET nonblocking mode fails on Win32 - here is
the fix

This ticket sounds similar to recently closed RT #7913. blocking() on
Win32 in IO​::Socket was implemented in
http​://perl5.git.perl.org/perl.git/commitdiff/2f78ce11bc4a9355ade5d20a0825b10fbb177169
in 5.9.4 in 2006. The OP was using 5.6.1 in 2004. I recommend close.

Accordingly, marking ticket resolved.

@p5pRT
Copy link
Author

p5pRT commented Nov 28, 2013

@jkeenan - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant