Search the web
Sign In
New User? Sign Up
ace-users
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Re: [ace-users] ACE_Reactor handle_output() does not work in win32   Message List  
Reply | Forward Message #30985 of 42992 |
Re: [ace-users] ACE_Reactor handle_output() does not work in win32

Ossama Othman wrote:
>
> Hi,
>
> On Wed, May 15, 2002 at 08:12:29PM +0530, K S Sreeram wrote:
> > > When relying on WRITE events using the ACE_WFMO_Reactor, you must
> > > therefore continue to write until the connection closes or the socket
> > > becomes flow controlled, i.e., a send fails with EWOULDBLOCK.
> >
> > if ( write() == EWOULDBLOCK ) then {
> > ...
> > . ...
> > ...
> > wmfo_reactor->handle_events()
> > }
> >
> > what happens when the socket transitions from flow-controlled to writeable
> > after the call to write but before the call to handle_events()? If WFMO, is
> > not going to notify the caller about the transition, then using WFMO_Reactor
> > for socket write notification would not be reliable, and hence should never
> > be used...
>
> The event hasn't been reported yet so presumably the WFMO reactor will
> still report the event. If not, then Windows'
> WaitForMultipleObjects() call bites. ;-)

Think of each waitable socket as having an internal flag. It is set
when EWOULDBLOCK is returned by a write, and reset when
WaitForMultipleObjects returns that the sockeet is writable. If your
application code doesn't cause the flag to toggle back and forth by
properly interleaving write() calls that return EWOULDBLOCK with
WaitForMultipleObjects() calls, then your code is broken.

--
Jon Biggar
Floorboard Software
jon@...
jon@...



Wed May 15, 2002 9:08 pm

jon@...
Send Email Send Email

Forward
Message #30985 of 42992 |
Expand Messages Author Sort by Date

Hi Sreeram, ... It's hard to say exactly what's going on without seeing your code. However, there's a discussion in Chapter 4 of C++NPv2 ...
Douglas C. Schmidt
schmidt@...
Send Email
May 15, 2002
12:54 pm

... if ( write() == EWOULDBLOCK ) then { ... . ... ... wmfo_reactor->handle_events() } what happens when the socket transitions from flow-controlled to...
K S Sreeram
sreeram@...
Send Email
May 15, 2002
3:11 pm

Hi, ... The event hasn't been reported yet so presumably the WFMO reactor will still report the event. If not, then Windows' WaitForMultipleObjects() call...
Ossama Othman
ossama@...
Send Email
May 15, 2002
8:46 pm

... Think of each waitable socket as having an internal flag. It is set when EWOULDBLOCK is returned by a write, and reset when WaitForMultipleObjects returns...
Jonathan Biggar
jon@...
Send Email
May 15, 2002
9:10 pm

Hi Jonathan, ... Right! However, most folks that have traditionally used select()/poll() may not be used to interleaving write() calls that return EWOULDBLOCK...
Ossama Othman
ossama@...
Send Email
May 15, 2002
10:59 pm

On Linux, g++ I tried to do this: CCFLAGS -= -W CCFlags -+ -Wall DCFLAGS -= -W DCFlags -+ -Wall OCFLAGS -= -W OCFlags -+ -Wall but it does not work---the -W...
Salman Khilji
salmankhilji@...
Send Email
May 16, 2002
12:46 pm

IIRC the default makefile flags for C++ are: CXX - compiler CXXFLAGS - compiler flags By the way, -Wall won't disable warnings. ... ...
Andrew Sutton
ansutton@...
Send Email
May 16, 2002
1:56 pm

... GNU Make is not C or C++. There is no -=. If you want to remove this flag permanently for all compilation, set the flag in platform_macros.GNU like this: ...
Krishnakumar B
kitty@...
Send Email
May 16, 2002
5:16 pm

Hi Justin, ... its ... to ... the ... Yes, emphasis on "becomes". ... Not really... this may be a niggling point, but I want to avoid confusion... the event is...
Steve Huston
shuston@...
Send Email
May 17, 2002
4:46 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help