An error is returned if the connection is unsuccessful, but an address bound by the system remains. If the connection is successful, the socket is associated with the server and data transfer can begin.
The following table lists some of the more common errors returned when a connection attempt fails.
Table 7–1 Socket Connection Errors
Socket Errors |
Error Description |
---|---|
ENOBUFS |
Lack of memory available to support the call. |
EPROTONOSUPPORT |
Request for an unknown protocol. |
EPROTOTYPE |
Request for an unsupported type of socket. |
ETIMEDOUT |
No connection established in specified time. This error happens when the destination host is down or when problems in the network cause in lost transmissions. |
ECONNREFUSED |
The host refused service. This error happens when a server process is not present at the requested address. |
ENETDOWN or EHOSTDOWN |
These errors are caused by status information delivered by the underlying communication interface. |
ENETUNREACH or EHOSTUNREACH |
These operational errors can occur because no route to the network or host exists. These errors can also occur because of status information returned by intermediate gateways or switching nodes. The status information that is returned is not always sufficient to distinguish between a network that is down and a host that is down. |