1SCTP_CONNECTX(3) Linux Programmer's Manual SCTP_CONNECTX(3)
2
3
4
6 sctp_connectx - initiate a connection on an SCTP socket using multiple
7 destination addresses.
8
10 #include <sys/types.h>
11 #include <sys/socket.h>
12 #include <netinet/sctp.h>
13
14 int sctp_connectx(int sd, struct sockaddr * addrs, int addrcnt,
15 sctp_assoc_t * id);
16
18 sctp_connectx initiates a connection to a set of addresses passed in
19 the array addrs to/from the socket sd. addrcnt is the number of
20 addresses in the array.
21
22 If sd is an IPv4 socket, the addresses passed must be IPv4 addresses.
23 If sd is an IPv6 socket, the addresses passed can be either IPv4 or
24 IPv6 addresses.
25
26 addrs is a pointer to an array of one or more socket addresses. Each
27 address is contained in its appropriate structure(i.e. struct sock‐
28 addr_in or struct sockaddr_in6). The family of the address type must be
29 used to distinguish the address length. The caller specifies the number
30 of addresses in the array with addrcnt.
31
32 id is a pointer to the association id and, if provided, will be set to
33 the identifier of the newly created association.
34
36 On success, 0 is returned. On failure, -1 is returned, and errno is set
37 appropriately.
38
40 EBADF sd is not a valid descriptor.
41
42 ENOTSOCK
43 sd is a descriptor for a file, not a socket.
44
45 EFAULT Error while copying in or out from the user address space.
46
47 EINVAL Invalid port or address.
48
49 EACCES The address is protected, and the user is not the super-user.
50
51 EISCONN
52 The socket is already connected.
53
54 ECONNREFUSED
55 No one listening on the remote address.
56
57 ETIMEDOUT
58 Timeout while attempting connection. The server may be too busy
59 to accept new connections. Note that for IP sockets the timeout
60 may be very long when syncookies are enabled on the server.
61
62 ENETUNREACH
63 Network is unreachable.
64
65 EADDRINUSE
66 Local address is already in use.
67
68 EINPROGRESS
69 The socket is non-blocking and the connection cannot be com‐
70 pleted immediately. It is possible to select(2) or poll(2) for
71 completion by selecting the socket for writing. After select
72 indicates writability, use getsockopt(2) to read the SO_ERROR
73 option at level SOL_SOCKET to determine whether connect com‐
74 pleted successfully (SO_ERROR is zero) or unsuccessfully
75 (SO_ERROR is one of the usual error codes listed here, explain‐
76 ing the reason for the failure).
77
78 EALREADY
79 The socket is non-blocking and a previous connection attempt has
80 not yet been completed.
81
82 EAGAIN No more free local ports or insufficient entries in the routing
83 cache. For PF_INET see the net.ipv4.ip_local_port_range sysctl
84 in ip(7) on how to increase the number of local ports.
85
86 EAFNOSUPPORT
87 The passed address didn't have the correct address family in its
88 sa_family field.
89
90 EACCES, EPERM
91 The user tried to connect to a broadcast address without having
92 the socket broadcast flag enabled or the connection request
93 failed because of a local firewall rule.
94
96 sctp(7) sctp_bindx(3), sctp_sendmsg(3), sctp_send(3), sctp_recvmsg(3),
97 sctp_peeloff(3), sctp_getpaddrs(3), sctp_getladdrs(3),
98 sctp_opt_info(3),
99
100
101
102Linux 2.6 2005-10-25 SCTP_CONNECTX(3)