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