1
votes

On a blocking socket, can flag MSG_WAITALL in a call to recv() be combined with socket option SO_RCVTIMEO set with a call to setsockopt() on the socket?

My goal here is to either receive a full message, or a timeout/error...

1
What happens when you try it? - President James K. Polk
The hardware on which it is to run is not ready yet. - Mikael Engström

1 Answers

1
votes

Have tested it now, and it works fine to combine MSG_WAITALL and SO_RCVTIMEO on blocking sockets!

A call to recv() then returns when the requested length has been received, or when the configured socket timeout expires (or if there is an error/interrupt).