R.. GitHub STOP HELPING ICE
R.. GitHub STOP HELPING ICE

Reputation: 215261

Does SO_RCVTIMEO affect accept()?

Does the SO_RCVTIMEO option affect accept (causing it to return EAGAIN or EWOULDBLOCK if the timeout expires)? Is there any behavior specified by the standard? I can't find it in the documentation for accept or use of options:

http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_10_16

Upvotes: 11

Views: 3462

Answers (1)

ninjalj
ninjalj

Reputation: 43688

While on POSIX SO_RCVTIMEO is defined for "an input function", and SO_SNDTIMEO is defined for "an output function", I can'r find any definition for "input function" or "output function", so I'll just say they are read/receive and write/send at least.

In the specific case of Linux, SO_RCVTIMEO affects accept(), as can be seen by looking at inet_csk_accept(), and SO_SND_TIMEO affects connect(), as can be seen by looking at tcp_sendmsg().

Upvotes: 20

Related Questions