Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- How to do Asynchronous I/O in win32?
September 6, 2007, 4:41 am
rate this thread
Re: How to do Asynchronous I/O in win32?
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 Event.pm.
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.
- » FAQ 3.8 Is there a pretty-printer (formatter) for Perl?
- — Previous thread in » PERL Discussions