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::Handle blocking always fails in windows [rt.cpan.org #53049] #17448

Open
toddr opened this issue Apr 19, 2018 · 2 comments
Open

IO::Handle blocking always fails in windows [rt.cpan.org #53049] #17448

toddr opened this issue Apr 19, 2018 · 2 comments

Comments

@toddr
Copy link
Member

toddr commented Apr 19, 2018

Migrated from rt.cpan.org#53049 (status was 'new')

Requestors:

Attachments:

From [email protected] on 2009-12-24 06:58:24:

In module IO::Handle using strawberry perl v5.10.0 on Windows 7 64 bit OS,
$io->blocking(0) always fails with $! set to "Unknown error"


Sample code to produce the bug is attached

@toddr toddr transferred this issue from Dual-Life/IO Jan 20, 2020
@toddr toddr added Needs Triage dist-IO issues in the dual-life blead-first IO distribution labels Jan 20, 2020
@toddr
Copy link
Member Author

toddr commented Jan 31, 2020

#!/usr/bin/perl

use strict;
use warnings;
use IO::File;
print $! if(!STDIN->blocking(0)) ;
 $_ = <STDIN>;
if(defined) {
print "You were quick";
exit;
}
sleep 5;
 $_ = <STDIN>;
if(defined)
{
	print "Atleast you can type";
	exit;
}
print "You are totally useless";

@tonycoz
Copy link
Contributor

tonycoz commented May 5, 2020

Only sockets support setting non-blocking mode on Win32.

Otherwise I believe only named pipes can be made non-blocking, but neither the perl core nor IO provide an interface to Win32 named pipes.

@jkeenan jkeenan added distro-mswin32 and removed dist-IO issues in the dual-life blead-first IO distribution labels Apr 7, 2021
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

3 participants