![]() ![]() ![]() I'd like to provide simple code for others to test. Send returns 0 when you send(socket, buf, 0, 0) You do have the possibility that it will return less than the bytes you requested to send and you therefore should have code in place to handle that.Īnd, since it will be pretty much the same logic handling 'one less than what you requested' as handling 'zero bytes', you may as well assume it can return zero. I'm not entirely certain that's the case now since the current Posix standard seems to indicate it will simply block in that case (or fail if it's set up for non-blocking). ![]() I'm pretty certain, though the memory is deep in the mists of time, that I've seen it return zero before, in the situation of massive data transfers where the other end was not keeping up.įrom memory, in that case, the remote TCP stack buffers had filled up, the stack had notified the local end that it was to delay until some space was cleared out and the local buffers had filled up as well.Īt that point, it's not technically an error (hence no -1 returned) but no data could be accepted by the local stack.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
June 2023
Categories |