How to do Asynchronous I/O in win32?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Quoted text here. Click to load it

Repair the corrupted file:

   perl -p -i -e 'tr/\r//d' bad_file

    Tad McClellan                          SGML consulting                   Perl programming
    Fort Worth, Texas

Re: How to do Asynchronous I/O in win32?

Quoted text here. Click to load it

If you want to use real Win32 overlapped IO, you can use the functions
in Win32API::File. You will need to closely refer to the MSDN
documentation for these, though: the interface is currently not very
friendly, and you will need to build your own OVERLAPPED structure using

I was about to suggest using POE, as that is the standard suggestion for
event loops, but it appears not to support operations on ordinary files
under Win32 (due to select(2) being deeply broken). If you only want to
monitor sockets, you should be able to use any of the select-based
systems: POE has its own, or you can use

If you are a C programmer, and you like the libiocp interface, you could
try your hand at wrapping it in an XS module. It doesn't look too hard:
you would need to write your own set of C callbacks to register, and
then have those callbacks call the Perl callbacks (if that makes sense
:) ). Start by reading perlxs, and you'll probably need to follow that
with perlcall. Or you could use Inline::C, though given that you'd still
have to have C-callbacks-calling-Perl-callbacks I doubt it would be much

Good luck: this is clearly an area where Perl's Win32 support needs
work, so I hope you can find something that does what you need.


Site Timeline