in reply to Re^5: How to Multiplex a Client using IO::Select
in thread How to Multiplex a Client using IO::Select
How would you construct the above snippet?
my ($r, $w) = winsocketpair(); $w->autoflush(1); async { print $w $_ while defined( $_ = <STDIN> ); }->detach; while( 1 ) { if ( my ($readers, $writers, $exceptors) = IO::Select::select($selector, $selector, $selector) ) { for( @$readers ) { ## See what they have to say } for( @$writers ) { ## Tell'em what they need to know } for( @$exceptors ) { ## Deal with their tantrums } } }
Have you tried Win32::Socketpair yet?
Turns out it crashes :(
Update: Removing the calls to ioctl removes the crash and makes the module work. I don't know at what cost, though.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: How to Multiplex a Client using IO::Select
by BrowserUk (Patriarch) on Oct 13, 2008 at 14:49 UTC | |
by ikegami (Patriarch) on Oct 13, 2008 at 14:55 UTC | |
by BrowserUk (Patriarch) on Oct 13, 2008 at 15:55 UTC |