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:46:26 GMT
Link to WSASend was broken trying to resend

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcecomm
5/html/wce50lrfwsasend.asp

-----Original Message-----
From: Konstantin Sharenkov 
Sent: Tuesday, March 21, 2006 9:44 AM
To: James Mansion; Paul Querna; dev@apr.apache.org
Subject: RE: [RFC] apr_pollcb api?

Hello. 
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 )
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcecomm
5/html/wce50lrfwsasend.asp

see parameter  
LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine

Or 
LPWSAOVERLAPPED lpOverlapped,
For event based


Also you can read 
http://support.microsoft.com/default.aspx?scid=kb;en-us;181611#XSLTH3129
121122120121120120


Files, pipes and devices also supports such IO methods
Please see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc
/base/synchronization_and_overlapped_input_and_output.asp


With best regards, 
Konstantin


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






Mime
View raw message