- 论坛徽章:
- 0
|
I have the following statement of C programming under HP-UX 11.0:
-----------------------------------------------------------------------------------------------------------
flags = 0;
nread = recv( sock, (char *)buf + totread, len - totread, flags );
-----------------------------------------------------------------------------------------------------------
Sometimes I encountered with the following error:
nread = 0
Looking up the manual, I knew that it indicates the following information:
-----------------------------------------------------------------------------------------------------------------
0 The socket is blocking and the transport connection to the
remote node failed.
-----------------------------------------------------------------------------------------------------------------
However, sometimes the following error was faced:
nread = -1, errno = 232
indicating that:
------------------------------------------------------------------------------------------------------------------
[ECONNRESET] A connection was forcibly closed by a peer.
------------------------------------------------------------------------------------------------------------------
Who can tell me what the differences are between the two scenarios? |
|