apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Sharenkov" <Konstantin.Sharen...@enterra-inc.com>
Subject RE: [RFC] apr_pollcb api?
Date Tue, 21 Mar 2006 03:43:54 GMT
I think you wrong when say "This sort of reactive design doesn't fit
well in Win32. Win32 is 'completion' based "

WinAPI contains also Callback based (in windows terminology - completion
routine) and event based asynchronous methods of IO.

Please see for example WSASend function ( Send to seocket )

see parameter  

For event based

Also you can read 

Files, pipes and devices also supports such IO methods
Please see

With best regards, 

-----Original Message-----
From: James Mansion [mailto:james@wgold.demon.co.uk] 
Sent: Monday, March 20, 2006 12:24 PM
To: Paul Querna; dev@apr.apache.org
Subject: RE: [RFC] apr_pollcb api?

>- How could win32 fit into this type of API?  It would be
> awesomr if we could ditch select() on win32.

This sort of reactive design doesn't fit well in Win32.
Win32 is 'completion' based.  You need to have a callback
structure that handles partial or full completions.  cf the
selector and proactor stuff in ACE.

You can implement the completion-based stuff with select etc,
but not the other way around.  Personally, I find the
completion view much more natural - I hardly ever generate
content because I have buffer space to write to, and buffers
are cheap enough to come by now to have some space allocated
to each socket, even if its 'only' a small buffer that will
handle a fixed message header, or is likely to tell me what
sort of HTTP request I'm going to deal with.

View raw message