connect.2 (2010 09)

c
connect(2) connect(2)
[ENETUNREACH] The network is not reachable from this host.
For AF_CCITT only: X.25 Level 2 is down. The X.25 link is not working:
wires might be broken, connections are loose on the interface hoods at the
modem, the modem failed, or noise interfered with the line for an
extremely long period of time.
[ENOBUFS] No buffer space is available. The
connect() has failed.
[ENODEV] The x25ifname field refers to a nonexistent interface.
[ENOENT] The file or the directory path specified in the target address for AF_UNIX
domain does not exist.
[ENOMEM] No memory is available. The
connect() has failed.
[ENOPROTOOPT] The remote system or an intermediate system in the communications path
does not support a protocol option sent by the local system. This option
may have been set using a
getsockopt() or
setsockopt() call, or
set as a system parameter.
[ENOSPC] All available virtual circuits are in use.
[ENOTSOCK] s is a valid file descriptor, but it is not a socket.
[EOPNOTSUPP] The socket referenced by s does not support
connect(); an attempt is
made to issue a connect() call on a listen() socket.
[ETIMEDOUT] Connection establishment timed out without establishing a connection.
One reason could be that the connection requests queue at the remote
socket may be full (see listen (2)).
OBSOLESCENCE
Currently, the
socklen_t and size_t types are the same size. This is compatible with the UNIX 95
and UNIX 03 profiles. However, in a future release, socklen_t might be a different size, but that
should not adversely affect application behavior in this case. Applications may use socklen_t now.
But applications that need to be portable to the UNIX 95 profile should follow the X/Open specification
(see xopen_networking(7)).
WARNINGS
Linking binary objects compiled to X/Open Sockets specification and binary objects compiled to HP-UX
BSD Sockets specification to the same executable may result in unexpected behavior, including applica-
tion abnormal termination and unexpected socket errors. See xopen_networking(7) for details and
remedy.
FUTURE DIRECTION
Currently, the default behavior is the HP-UX BSD Sockets; however, it might be changed to X/Open
Sockets in a future release. At that time, any HP-UX BSD Sockets behavior that is incompatible with
X/Open Sockets might be obsoleted. Applications that conform to the X/Open specification now will
avoid migration problems (see xopen_networking(7)).
AUTHOR
connect() was developed by HP and the University of California, Berkeley.
SEE ALSO
accept(2), bind(2), fcntl(2), getsockname(2), getsockopt(2), ioctl(2), listen(2), select(2), socket(2), fcntl(5),
ioctl(5), privileges(5), thread_safety(5), socket(7), xopen_networking(7).
STANDARDS CONFORMANCE
connect(): XPG4, UNIX 95, UNIX 03
HP-UX 11i Version 3: September 2010 3 Hewlett-Packard Company 3