[ace-users] recv_n and send_n with No Timeout

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Sun Aug 5 10:19:50 CDT 2007


Hi Saul,

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.

>I am using ACE as a client. I do a recv_n / send_n with timeout = 0.
>Now; I am running into the following scenario:
>1. The other side is an embedded system.
>2. If for some reason the Host Computer (where I am running ACE)
>detects that the embedded system has crashed (i.e. some time has
>passed and recv_n / send_n have not returned); is there a way I can
>quit waiting so that I can proceed to do recovery work on the
>communication threads (i.e. the ones using ACE) ?

Can you simply use timeouts to do this?

>a) I read something about ACE having support for
>WaitForMultipleObjects, but not sure how I can relate this to my
>ACE_SOCK_Stream object doing the send_n / recv_n.

Please see Chapter 3 of C++NPv1 <www.cs.wustl.edu/~schmidt/ACE/book1/>
for info on using timeouts with the send*/recv* methods.

>b) Can I close the socket from within another function and expect
>send_n/recv_n to return with some error code ?

It's not clear what you mean here - can you give a short example please?

>I am reading ACE Practical Design Patterns for Network and Systems
>Programming, but have not been able to get the answers to neither of
>my questions.

Please see C++NPv1.

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