Open System Services System Calls Reference Manual (G06.25+, H06.03+)

connect(2) OSS System Calls Reference Manual
If timeout occurs, the connect() call fails and errno is set to [ETIMEDOUT]; the connection is
aborted.
If a connect() call is interrupted by a signal that is caught while the call is blocked waiting to
establish a connection, the connect() call fails and sets errno to [EINTR]; the connection is not
aborted and is later established asynchronously.
When a connection cannot be created immediately and O_NONBLOCK is set for the le
descriptor of the socket, the connect() call fails and sets errno to [EINPROGRESS]; the connec-
tion is not aborted and is later established asynchronously. Subsequent calls to the
connect()
function for the same socket before the connection is completed will fail and set errno to [EAL-
READY].
NOTES
When an asynchronous connection is complete, a call to the select() function indicates that the
le descriptor for the socket is ready for writing.
RETURN VALUES
Upon successful completion, the connect() function returns the value 0 (zero). Otherwise, the
value -1 is returned and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the connect() function sets errno to the corresponding
value:
[EACCES] The socket is in the AF_UNIX domain and either search permission is denied for
a component of the pathname in the sockaddr structure, or write access to the
specied socket is denied.
[EADDRINUSE]
An attempt was made to establish a connection using addresses that are already
in use.
[EADDRNOTAVAIL]
The specied address is not available from this HP NonStop node.
[EAFNOSUPPORT]
Addresses in the specied address family cannot be used with this socket.
[EALREADY] A connection request is already in progress for the specied socket.
[EBADF] The socket parameter is not a valid le descriptor.
[ECONNREFUSED]
The specied address is not listening for connections or rejected the attempt to
connect.
[ECONNRESET]
One of the following conditions occurred:
The transport-provider process for this socket is no longer available.
The TCP/IP subsystem for this socket is no longer available.
The connection was forcibly closed by the peer socket.
The socket can only be closed.
128 Hewlett-Packard Company 527186-003