1.1.24.8 connect

C

int connect(int fd, const struct sockaddr *addr, socklen_t len)

Description

Initiate a connection on a socket.

Parameters

ParametersDescription
fdSocket file descriptor.
addrPointer to socket address.
lenLength of socket address.

Returns

  • 0 - Success.

  • -1 - Error, errno set.

Remarks

errnoDescription
EFAULTSystem fault.
ENOTSOCKThe file descriptor fd does not refer to a socket.
EAFNOSUPPORTThe implementation does not support the specified address family.
ENOMEMInsufficient memory is available.
EBADMSGBad message.
EINPROGRESSThe socket is nonblocking and the connection cannot be completed immediately.