in reply to Re^2: Alternative for Select for pipes in Windows?
in thread Alternative for Select for pipes in Windows?
Replace the winsocket pair sub with this:
sub winsocketpair { my $proto = getprotobyname('tcp'); my $first = 1; for (1..5) { if ($first) { undef $first; } else { carp "winsocketpair failed: $!, retrying" } socket(my $listener, AF_INET, SOCK_STREAM, $proto) or return (); socket(my $server, AF_INET, SOCK_STREAM, $proto) or return (); socket(my $client, AF_INET, SOCK_STREAM, $proto) or return (); my $true = 1; ioctl($client, 0x8004667e, \$true ); my $addr = sockaddr_in(0, INADDR_LOOPBACK); bind($listener, $addr) or return (); listen($listener, 1) or return (); $addr = getsockname($listener); connect($client, $addr) or $! == 10035 or $! == EINPROGRESS or next; my $peer = accept($server, $listener) or next; my $false = 0; ioctl($client, 0x8004667e, \$false ); if ($peer eq getsockname($client)) { return ($server, $client); } } return (); }
And ignore make test--the tests seem to be broken. They sometime pass and sometimes fail?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Alternative for Select for pipes in Windows?
by ikegami (Patriarch) on Nov 06, 2010 at 05:26 UTC | |
by BrowserUk (Patriarch) on Nov 06, 2010 at 06:11 UTC | |
|
Re^4: Alternative for Select for pipes in Windows?
by matematiko (Novice) on Nov 08, 2010 at 00:38 UTC | |
by BrowserUk (Patriarch) on Nov 08, 2010 at 00:52 UTC |