Commit 7949f681 authored by aligungr's avatar aligungr

Socket::send errno EAGAIN handling

parent 34aca71c
......@@ -184,8 +184,12 @@ int Socket::receive(uint8_t *buffer, size_t bufferSize, int timeoutMs, InetAddre
void Socket::send(const InetAddress &address, const uint8_t *buffer, size_t size) const
{
ssize_t rc = sendto(fd, buffer, size, MSG_DONTWAIT, address.getSockAddr(), address.getSockLen());
if (static_cast<size_t>(rc) != size)
throw LibError("sendto failed: ", errno);
if (rc == -1)
{
int err = errno;
if (err != EAGAIN)
throw LibError("sendto failed: ", errno);
}
}
bool Socket::hasFd() const
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment