[ace-users] Incomplete data being read from the socket

Steve Huston shuston at riverace.com
Wed Aug 22 12:49:29 CDT 2007

Hi Gaurav,

Thank you for the PROBLEM-REPORT-FORM.

>      5.4a_p2 

Is this an OCI release? If so, and this turns out to be an ACE issue,
please contact OCI for further assistance.

> In my application we have a client application written in C++ using
> ACE library this application reads the data over the socket. The
> coming in is huge. Hence, the read happens in chunks of 1024 bytes.
> For instance the total data to be read is 10240 then the recv call
> be made 10 times. And the to check if call the data has been
received the
> length of the return value is checked if the length is less than the
> buffer size then it is assumed that complete data has been read.

This is not a valid check. It is quite possible that buffering at the
protocol layers will break your data up into any sized pieces. 

> Any suggestion would be valuable.

You should either keep reading until there is no more data (for
example, a non-blocking recv() returns -1/EWOULDBLOCK), or add a count
to your application-level protocol so you know how much data to


Steve Huston, Riverace Corporation
Would you like ACE to run great on your platform?
See http://www.riverace.com/sponsor.htm

More information about the Ace-users mailing list