connect.2 (2010 09)
c
connect(2) connect(2)
AF_CCITT Only
Use the x25addrstr struct for the address structure. The caller must know the X.121 address of the
DTE to which the connection is to be established, including any subaddresses or protocol IDs that may be
needed. If address-matching by protocol ID, specify the protocol ID with the
X25_WR_USER_DATA
ioctl() call before issuing the connect() call.
X/Open Sockets Compilation Environment
See xopen_networking(7).
DEPENDENCIES
AF_CCITT
The
SO_REUSEADDR option to setsockopt() is not supported for sockets in the AF_CCITT address
family.
RETURN VALUE
connect() returns the following values:
0 Successful completion.
-1 Failure.
errno is set to indicate the error.
ERRORS
If
connect() fails, errno is set to one of the following values:
[EADDRINUSE] The specified address is already in use.
For datagram sockets, the peer address is no longer maintained by the sys-
tem.
[EADDRNOTAVAIL] The specified address is not available on this machine, or the socket is a
TCP/UDP socket and the zero port number is specified.
For datagram sockets, the peer address is no longer maintained by the sys-
tem.
[EAFNOSUPPORT] The specified address is not a valid address for the address family of this
socket.
For datagram sockets, the peer address is no longer maintained by the sys-
tem.
[EALREADY] Nonblocking I/O is enabled with
O_NONBLOCK, O_NDELAY,or
FIOSNBIO, and a previous connection attempt has not yet completed.
[EBADF] s is not a valid file descriptor.
[ECONNREFUSED] The attempt to connect was forcefully rejected.
[EFAULT] addr is not a valid pointer.
[EINPROGRESS] Nonblocking I/O is enabled using
O_NONBLOCK, O_NDELAY,or
FIOSNBIO, and the connection cannot be completed immediately. This is
not a failure. Make the connect() call again a few seconds later. Alter-
natively, wait for completion by calling select() and selecting for write.
[EINTR] The connect was interrupted by a signal before the connect sequence was
complete. The building of the connection still takes place, even though the
user is not blocked on the
connect() call.
[EINVAL] The socket has already been shut down; addrlen is a bad value; the X.121
address length is zero, negative, or greater than 15 digits.
For datagram sockets, if addrlen is a bad value, the peer address is no
longer maintained by the system.
[EISCONN] The socket is already connected.
[ENETDOWN] The X.25 interface specified in the addr struct was found but was not in the
initialized state. x25ifname field name is an interface which has been shut
down or never initialized or suffered a power failure which erased its state
information.
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010