List of possible errno codes for TCP socket connections on Linux for recv/send?

174 views Asked by At

Is there a complete list of errno values that can be returned after recv and send, respectively, for TCP connections on Linux (connect has succeeded) that are caused by pure network errors?

I'm trying to differentiate between:

  • programming errors/memory failures like EBADF, EFAULT, EINVAL, ENOMEM etc.,
  • special errors like EWOULDBLOCK, EINTR, and
  • the case when the TCP connection has been terminated for any reason.

So far, for the case of the TCP connection has terminated for some reason, I have e.g. noticed that recv can result in ECONNRESET, EHOSTUNREACH, ETIMEDOUT and ENETUNREACH and that send can result in EPIPE, ECONNRESET, EHOSTUNREACH, ETIMEDOUT. Are there any others I need to handle?

I've tried to read the man pages for recv(2), send(2), tcp(7), ip(7), socket(7) but have so far not yet been able to find any documentation for why the ENETUNREACH error code being returned. Is this a documentation bug?

0

There are 0 answers