Subject: | Make IO::Socket::INET non-blocking work on Win32 |
On Win32, there is a special IOCTL necessary as used by Perlbal or in
[1]. It would be nice if IO::Socket::INET did this directly. The
following code is blatantly ripped out of the Perlbal distribution:
if ($^O eq 'MSWin32') {
# On Windows, we have to do this a bit differently.
# IO::Socket should really do this for us, but whatever.
my $do = 1;
ioctl($sock, 0x8004667E, \$do) or
die "Unable to make listener on $hostport non-blocking: $^E";
} else {
# Handle non-Win32 case
}
I haven't checked that code on cygwin, so I don't know if cygwin
emulates that part already or if it's necessary there as well.
Hope that helps,
-max
[1] http://perlmonks.org/index-log.pl?node_id=529837