What happens if signal interrupts sendto or recvfrom call on datagram socket? Can I expect that these calls always return -1 with errno == EINTR or they can return positive number of bytes, but I shall repeat the call entirely?
Asked
Active
Viewed 39 times
1 Answers
1
On a datagram socket, sendto
and recvfrom
always send and receive complete datagrams, or nothing at all. If they could stop in the middle of a datagram that would defeat the point of datagrams.
There is an exception - recvfrom
might cut off the end of a datagram if the buffer is too small. The entire datagram is received, but your program doesn't get to see all of it.

user253751
- 57,427
- 7
- 48
- 90