Tuesday, October 17, 2006

the return value of ACE_SOCK_Stream

The "_n()" I/O methods keep looping until all the data has been transferred. These methods also work for sockets in non-blocking mode i.e., they keep looping on EWOULDBLOCK. is used to make sure we keep making progress, i.e., the same timeout value is used for every I/O operation in the loop and the timeout is not counted down.

The return values for the "*_n()" methods match the return values from the non "_n()" methods and are specified as follows:
*- On complete transfer, the number of bytes transferred is returned.
* - On timeout, -1 is returned, errno == ETIME.
* - On error, -1 is returned, errno is set to appropriate error.
* - On EOF, 0 is returned, errno is irrelevant.

No comments: