Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to do Asynchronous I/O in win32?

Reply
Thread Tools

How to do Asynchronous I/O in win32?

 
 
sonet
Guest
Posts: n/a
 
      09-06-2007
Have any modules like http://www.summerblue.net/computing/libiocp/index.html
for win32-perl ?


 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      09-06-2007

Quoth "sonet" <>:
> Have any modules like http://www.summerblue.net/computing/libiocp/index.html
> for win32-perl ?


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
pack.

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
easier.

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.

Ben

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
asynchronous counter an Xilinx FPGA for a newbie Georges Konstantinidis VHDL 12 08-04-2006 04:42 AM
Coding an Asynchronous state machine Jamie VHDL 13 10-23-2003 08:41 AM
Send a PULSE on input change, asynchronous Jamie VHDL 4 10-22-2003 06:57 AM
asynchronous design Amir VHDL 3 10-10-2003 02:10 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57