[ace-users] How to provide timeout for read operations in ACE_IOStream

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Mon Sep 10 19:36:21 CDT 2007


Hi Torsten,

Thanks for using the PRF.

> ACE VERSION: 5.3

Please upgrade to ACE+TAO+CIAO x.6 (i.e., ACE 5.6, TAO 1.6, and CIAO
0.6), which you can download from

http://download.dre.vanderbilt.edu

under the heading: "Latest Release."

The DOC groups at Washington University, UC Irvine, and Vanderbilt
University only provide "best effort" support for non-sponsors for the
latest release, as described in

http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/ACE/docs/ACE-bug-process.html

Thus, if you need more "predictable" help for earlier versions of
ACE+TAO, I recommend that you check out

http://www.dre.vanderbilt.edu/support.html

for a list of companies that will provide you with ACE+TAO commercial
support.

> HOST MACHINE and OPERATING SYSTEM:
> Windows XP SP2 on Dell D620 laptop running Intel Core 2 1.6Ghz , 2G RAM
> 
> Target same as Host
> 
> Running Visual Studio 6.0,
> compiler: Microsoft (R) 32-bit C/C++ 
> 
> #include "ace/Time_Value.h"
> #include "ace/IOStream_T.h"
> #include "ace/SOCK_Connector.h"
> 
> #if defined (ACE_LACKS_ACE_IOSTREAM)
> 
> 
> AREA/CLASS/EXAMPLE AFFECTED:
> 
> DOES THE PROBLEM AFFECT:
> Usage
> 
> SYNOPSIS:
> How to provide timeout for read operation in ACE_IOStream?

I don't think there's any way to do this at this point.  If you'd
like to add this capability to ACE_IOStream and submit patches relative
to ACE 5.6 that would be great!

thanks,

        Doug

> DESCRIPTION:
> By using ACE_IOSTREAM there is a needs having timeout for read operation if methode eof has been used. Member recv_timeout_value_ could be set by using methode recv_timeout(ACE_Time_Value *tv) but I have not access to the underlying STREAM (ACE_Streambuf).
> Example as following:
> 
> ACE_IOStream<ACE_SOCK_Stream> server;
> // preparing IP connection object
> ACE_SOCK_Connector connector;
> ACE_INET_Addr addr( iPort, sIp.c_str() );
> 
> if( connector.connect( server, addr ) )
> {
> char c = 0;
> while( !server.eof() )
> {
> server.recv( &c, 1 );
> // do something
> }
> }
> server.close();
> 
> There is an extract operator given but I don't know how to use it.
> ACE_IOStream<STREAM> & operator>> (ACE_Time_Value *&tv);
> 
> Torsten
> 
> 
> -- 
> GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
> Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
> 
> _______________________________________________
> ace-users mailing list
> ace-users at mail.cse.wustl.edu
> http://mail.cse.wustl.edu/mailman/listinfo/ace-users



More information about the Ace-users mailing list