[Ace-users] [ace-users] Associate state/context with asynchronous socket read/write operations

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Fri Jan 25 22:13:51 CST 2008


Hi Andi,

>I'm new to ACE and I'm trying to use ACE and the proactor pattern for
>some asynchronous data transfers with TCP and UDP. 

Welcome to ACE!  To ensure that we have proper
version/platform/compiler information, please make sure you fill out
the appropriate problem report form (PRF), which is in

$ACE_ROOT/PROBLEM-REPORT-FORM
$TAO_ROOT/PROBLEM-REPORT-FORM

or in

$ACE_ROOT/BUG-REPORT-FORM
$TAO_ROOT/BUG-REPORT-FORM

in older versions of ACE+TAO.  Make sure to include this information
when asking any questions about ACE+TAO since otherwise we have to
"guess" what version/platform/compiler/options you've using, which is
very error-prone and slows down our responsiveness.  If you don't use
the PRF, therefore, it is less likely that someone from the core
ACE+TAO developer team will be able to answer your question.
Naturally, we encourage and appreciate other members of the ACE+TAO
user community who can respond to questions that they have the answers
to.

> My main question at
> the moment is whether there is any way to associate a state or context
> with the asynchronous operation.

Sure - you can use the Asynchronous Completion Token pattern for this.
Please see the discussion of this pattern in the POSA2 book
<www.cs.wustl.edu/~schmidt/POSA/POSA2/> for details.

>When I start the async write or read, I would like to associate some
>state object with that call that I could retrieve again in the
>handle_read_stream or handler_write_stream either from the asynch
>result or from ACE somehow.

Please see Chapter 8 of C++NPv2 <www.cs.wustl.edu/~schmidt/ACE/book2/>
for an overview of the Proactor pattern.

Thanks,

     Doug
-- 
Dr. Douglas C. Schmidt                       Professor and Associate Chair
Electrical Engineering and Computer Science  TEL: (615) 343-8197
Vanderbilt University                        WEB: www.dre.vanderbilt.edu/~schmidt
Nashville, TN 37203                          NET: d.schmidt at vanderbilt.edu



More information about the Ace-users mailing list