CONNECT 2
NAME
connect - connects a socket
SYNOPSIS
#include <sys/socket.h>
int connect(int sd, const struct sockaddr * addr, socklen_t addr_len);
DESCRIPTION
connect() connects the socket sd to a socket listening at
address addr.
RETURN VALUES
On success, this function returns 0. On error, -1 is returned and
errno is set.
ERRORS
15 [EFAULT] The address pointed to by addr is not in a valid part of the process address space.
15 [EAFNOSUPPORT] The address family of the address pointed to by addr is not supported by this function.
15 [EINVAL] The address pointed to by addr is not valid.
15 [ENAMETOOLONG] The sun_path in struct sockaddr_un is too long.
15 [EACCES] The calling process doesn't have permission to perform the connect() operation.
15 [EISCONN] The socket is already connected.
15 [EALREADY] The socket is already in the process of connecting.
15 [ECONNREFUSED] The connection was refused.
SEE ALSO
socket(2), accept(2)