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

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

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 #30973 of 42992 |
Hi Sreeram,

>> I am using a non-blocking socket and i registered a handler for WRITE_MASK,
>> but handle_output() does not seem to get called on win32
>>
>>
>> It fails on the following platform :
>>
>> WinNT 4.0 SP6
>> MSVC++ 6 (SP5),
>> ACE 5.2.1
>>
>> The same identical code works as expected on Linux :
>>
>> Redhat Linux 7.2
>> ACE 5.2.1
>>
>>
>> Tracing thru the code in win32, shows that the code is blocked on
>> 'WaitForMultipleObjectsEx'.
>>
>> Maybe this API call does not get notified when sockets become ready for
>> writing ( i.e say flow control has reduced ).
>>
>> Any help would be appreciated

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
<www.cs.wustl.edu/~schmidt/ACE/book2/> that might help you out. Since
that book won't be published until the fall, here's the excerpt:

----------------------------------------

WRITE_MASK semantics different from select(). When a socket can send
more data, select() detects a WRITE condition. It will continue to
detect this condition as long as the socket remains writeable, that
is, until it becomes flow-controlled. In contrast, the Windows
WSAEventSelect() function only sets the WRITE event under two
conditions:

. When the socket is first connected, whether passively or actively
. When the socket transitions from flow-controlled to writeable

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 this
behavior is undesirable, you might consider choosing the
ACE_Select_Reactor as the ACE_Reactor implementation on Windows since
it has the same WRITE_MASK semantics as on UNIX platforms.

----------------------------------------

Take care,

Doug
--
Dr. Douglas C. Schmidt, Associate Professor TEL: (949) 824-1901
Dept of Electrical & Computer Engineering FAX: (949) 824-2321
616E Engineering Tower WEB: www.ece.uci.edu/~schmidt/
University of California, Irvine, 92697-2625 NET: schmidt@...



Wed May 15, 2002 12:52 pm

schmidt@...
Send Email Send Email

Forward
Message #30973 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