TSocket::write()
Patch: Adam Simpkins
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@
1162923 13f79535-47bb-0310-9956-
ffa450edef68
while (sent < len) {
uint32_t b = write_partial(buf + sent, len - sent);
if (b == 0) {
- // We assume that we got 0 because send() errored with EAGAIN due to
- // lack of system resources; release the CPU for a bit.
- usleep(50);
+ // This should only happen if the timeout set with SO_SNDTIMEO expired.
+ // Raise an exception.
+ throw TTransportException(TTransportException::TIMED_OUT,
+ "send timeout expired");
}
sent += b;
}