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
Parameters | Description |
---|---|
fd | Socket file descriptor. |
addr | Pointer to socket address. |
len | Length of socket address. |
Returns
0 - Success.
-1 - Error,
errno
set.
Remarks
errno | Description |
---|---|
EFAULT | System fault. |
ENOTSOCK | The file descriptor fd does not refer to a socket. |
EAFNOSUPPORT | The implementation does not support the specified address family. |
ENOMEM | Insufficient memory is available. |
EBADMSG | Bad message. |
EINPROGRESS | The socket is nonblocking and the connection cannot be completed immediately. |