in reply to Re: ioctl for non-blocking and blocking in Windows
in thread ioctl for non-blocking and blocking in Windows

my $nonblocking = 1; ioctl($sock, 0x8004667e, $nonblocking) or die "ioctl socket: $!\n"; my $sockread = sysread($sock, $buffer, $chunk); #should be non-blockin +g $nonblocking = 0; ioctl($sock, 0x8004667e, $nonblocking) or die "ioctl socket: $!\n"; $sockread = sysread($sock, $buffer, $chunk); #should block
The code above produces the helpful error message: "ioctl socket: Unknown error." I got rid of the die part and the socket was still blocking on the first read. If I replace $nonblocking with \$nonblocking, both reads are non-blocking. I, too, stumbled across that blog post and it seems to agree that you must pass ioctl a reference as the last argument.