[Ace-users] [ace-users] ACE_Event_Handler :: handle_output() humble question
shuston at riverace.com
Sat Oct 27 14:22:56 CDT 2007
> Hi folks! I'm new to this list and first of all I'd like to thank
> ACE developers for their hard work.
Welcome! In the future, please use the PROBLEM-REPORT-FORM in the
ACE_wrappers directory to supply all needed information when asking
> Probably this list is not a proper place for such question(please
> me if so) but I had no idea where to ask.
This is a good place.
> In short, I have the ClientAcceptor and ClientHandler classes
> from ACE_Event_Handler and registered in reactor: ClientAcceptor
> accepts new connections, creates ClientHandler and registers it in
> reactor too.
> ClientHandler class has handle_input(..) overridden and in this
> it extracts message objects from the socket and puts them into the
> input queue. This part works just fine ;)
> Each ClientHandler also has its own output queue of messages. This
> queue is filled by some application logic which processes input
> messages and reacts to them.
> The question is what is the best way to send notification to each
> ClientHandler to send a portion of its output messages in the queue?
> Is it ok to use handle_output() for very this purpose?
> Am I right in my thinking this is the proper way to trigger each
> ClientsHandler's handle_input(..)?
> reactor->notify(NULL, ACE_Event_Handler::WRITE_MASK);
> Maybe this problem has a more elegant solution I'm not aware of,
> please tell me ;)
You didn't say if you are using ACE_Message_Queue for the queue, but I
recommend you look at integrating notifications with the queue. Please
see section 7.6.3 in APG, or sidebar 38 on page 163 in C++NPv2. For
more information on these books, please see
Steve Huston, Riverace Corporation
Would you like ACE to run great on your platform?
More information about the Ace-users