in reply to Re: Non Blocking input on Win32 platforms
in thread Non Blocking input on Win32 platforms

It's worth mentioning that select only works on sockets under win32. Win32::Socketpair, provides a work around.

I've been working with Win32::Socketpair and I ran into a few snags. I haven't had time to contact the author with a proper bug report yet, but it is important to know that because winopen2 uses system(1, ...) to spawn child processes, you can only launch 64 processes under windows before it stops working. It is a simple matter to change the code to use Win32::Process::Create to spawn children. The other snag that I just encountered yesterday and haven't found a work around for yet is that using PerlApp 6 to bind your executables as GUI programs, means that STDIO to any children gets messed up in some mysterious way.

With those caveats, IO::Select makes it easy to do non-blocking IO.


TGI says moo

Replies are listed 'Best First'.
Re^3: Non Blocking input on Win32 platforms
by BrowserUk (Patriarch) on Nov 01, 2008 at 04:10 UTC

      It appears that my reading comprehension was poor yesterday. I've been fighting my own issues with stdio on windows (actually it seems to be related to issues of console inheritance and wperl), and it seems to have distorted my perception of the OP's problem.

      You are correct, it makes no sense to spawn a second process just to create a selectable IO source. But, I wasn't advocating that approach. Despite the fact that I communicated so poorly as to make it sound like I was.

      I recall our earlier exchange perfectly well.

      My comments on Win32::Socketpair (note the 'p') stem from the fact that you referenced a thread where it was discussed as a possible solution. In this context, I felt that sharing the shortcomings of Win32::Socketpair that I had recently discovered may be helpful.


      TGI says moo