|Subject:||IO::Handle::blocking does not work under windows 7 64bit|
IO::Handle::blocking seems to break the socket entity under windows 7 64bit(possible other OS'es). Attached is an example of breaking code: please adjust the port and address to something that is open on your side, and then try uncommenting either of the IO::Handle::blocking calls. The connect will fail with "unknown error" or "A non-blocking socket operation could not be completed immediately." depending on the perl distribution. Please note that $sock->blocking(0) or $sock->blocking(1) will also fail the same way. Issue present in both activeperl 5.10.1 and strawberry perl 5.12.1.
#!/usr/bin/perl use strict; use warnings; use Socket; use IO::Handle; my $sock; socket($sock, PF_INET, SOCK_STREAM, getprotobyname('tcp')) || die "socket: $!"; IO::Handle::blocking($sock, 1); #IO::Handle::blocking($sock, 0); connect($sock, sockaddr_in(3333, inet_aton("localhost"))) || die "connect: $!";