mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
socket: do not block in sendto()
This commit is contained in:
parent
6042ee92af
commit
0c8e52da4e
1 changed files with 3 additions and 1 deletions
|
@ -437,11 +437,13 @@ retry: ret = io_sprint(&s->io, buf, buflen, &wbytes, smps, cnt);
|
|||
case SOCKET_LAYER_UNIX: addrlen = SUN_LEN(&s->remote.sun); break;
|
||||
}
|
||||
|
||||
bytes = sendto(s->sd, buf, wbytes, 0, (struct sockaddr *) &s->remote, addrlen);
|
||||
bytes = sendto(s->sd, buf, wbytes, MSG_DONTWAIT, (struct sockaddr *) &s->remote, addrlen);
|
||||
if (bytes < 0) {
|
||||
if ((errno == EPERM) ||
|
||||
(errno == ENOENT && s->layer == SOCKET_LAYER_UNIX))
|
||||
warn("Failed send to node %s: %s", node_name(n), strerror(errno));
|
||||
else if ((errno == EAGAIN) || (errno == EWOULDBLOCK))
|
||||
warn("socket: send would block");
|
||||
else
|
||||
serror("Failed send to node %s", node_name(n));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue