[ace-users] Incomplete data being read from the socket
shuston at riverace.com
Wed Aug 22 12:49:29 CDT 2007
Thank you for the PROBLEM-REPORT-FORM.
> ACE VERSION:
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
> 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?
More information about the Ace-users