Subj. Strangely, I couldn't readily find this in socket reference docs for Windows or POSIX.
For the purpose of the question, I'm talking about any timeouts affecting socket API calls, i.e. any values that govern the time after which an API call would return with an error. So, something like TIME_WAIT is ruled out because it only affects system state rather than a program's control flow. The question is inspired by kill socket.accept() call on closed unix socket where the OP claims that an accept
would wait forever - which I don't believe.
- AFAICS, there are two: for receive and for send, which affect not only
send
/recv
, but all APIs that involve receiving or sending, likeaccept
.
More specifically:
- Is it mandated by some spec or is completely up to the OS vendor?
- What are the default values for major OSes1? At the very least, the orders of magnitude.
- If configurable system-wide, where are they stored (if there are many possibilities - from the kernel's/stock library's POV)?
1E.g. Windows, Debian, Red Hat, FreeBSD, Mac OS X, Android.