1sctp_sendmsg(3SOCKET) Sockets Library Functions sctp_sendmsg(3SOCKET)
2
3
4
6 sctp_sendmsg - send message from an SCTP socket
7
9 cc [ flag... ] file... -lsocket -lnsl -lsctp [ library... ]
10 #include <sys/types.h>
11 #include <sys/socket.h>
12 #include <netinet/sctp.h>
13
14 ssize_t sctp_sendmsg(int s, const void *msg, size_t len,
15 const struct sockaddr *to, socklen_t tolen, uint32_t ppid,
16 uint32_t flags, uint16_t stream_no, uint32_t timetolive,
17 uint32_t context);
18
19
21 The sctp_sendmsg() function sends a message from the SCTP endpoint s.
22
23
24 In addition to specifying msg as the message buffer and len as the
25 length of the buffer, the following parameters can be set:
26
27 to Destination address
28
29
30 tolen Length of the destination address
31
32
33 ppid Application-specified payload protocol identifier
34
35
36 stream_no Target stream for the message
37
38
39 timetolive Time period in milliseconds after which the message
40 expires if transmission for the message has not been
41 started. A value of 0 indicates that the message does not
42 expire. When the MSG_PR_SCTP flag is set the message
43 expires, even if transmission has started, unless the
44 entire message is transmitted within the timetolive
45 period.
46
47
48 context Value returned when an error occurs in sending a message
49
50
51
52 The flags parameter is formed from the bitwise OR of zero or more of
53 the following flags:
54
55 MSG_UNORDERED This flag requests un-ordered delivery of the message.
56 If this flag is clear the message is considered an
57 ordered send.
58
59
60 MSG_ABORT When set, this flag causes the specified association
61 to abort by sending an ABORT to the peer. The flag is
62 used only for one-to-many style SCTP socket associa‐
63 tions.
64
65
66 MSG_EOF When set, this flag invokes a graceful shutdown on a
67 specified association. The flag is used only for one-
68 to-many style SCTP socket associations.
69
70
71 MSG_PR_SCTP This flag indicates that the message is treated as
72 partially reliable. The message expires unless the
73 entire message is successfully transmitted within the
74 time period specified in the timetolive parameter.
75
76 MSG_PR_SCTP implements timed reliability service for
77 SCTP messages. As yet, no common standard has been
78 defined for the service and the interface is consid‐
79 ered unstable.
80
81
82
83 The initial call to sctp_sendmsg() can be used to create an associa‐
84 tion, but it cannot be used subsequently on an existing association.
85 Since sctp_sendmsg() always uses 0 internally as the association ID, it
86 is not suitable for use on one-to-many sockets.
87
89 Upon successful completion, the sctp_sendmsg() function returns the
90 number of bytes sent. The function returns -1 if an error occurs.
91
93 The sctp_sendmsg() function will fail if:
94
95 EBADF The s argument is an invalid file descriptor.
96
97
98 ENOTSOCK The s argument is not a socket.
99
100
101 EOPNOTSUPP MSG_OOB is set as a flag.
102
103
104 EOPNOTSUPP MSG_ABORT or MSG_EOF is set on a one-to-one style SCTP
105 socket.
106
107
108 EPIPE The socket is shutting down and no more writes are
109 allowed.
110
111
112 EAGAIN The socket is non-blocking and the transmit queue is
113 full.
114
115
116 ENOTCONN There is no established association.
117
118
119 EINVAL Control message length is incorrect.
120
121
122 EINVAL Specified destination address does not belong to the
123 association.
124
125
126 EAFNOSUPPORT Address family of the specified destination address is
127 other than AF_INET or AF_INET6.
128
129
131 See attributes(5) for descriptions of the following attributes:
132
133
134
135
136 ┌─────────────────────────────┬─────────────────────────────┐
137 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
138 ├─────────────────────────────┼─────────────────────────────┤
139 │Interface Stability │Committed │
140 ├─────────────────────────────┼─────────────────────────────┤
141 │MT-Level │Safe │
142 └─────────────────────────────┴─────────────────────────────┘
143
145 accept(3SOCKET), bind(3SOCKET), connect(3SOCKET), in.h(3HEAD), lib‐
146 sctp(3LIB), listen(3SOCKET), sendmsg(3SOCKET), socket(3SOCKET),
147 socket.h(3HEAD), attributes(5), sctp(7P)
148
149
150
151SunOS 5.11 22 Aug 2007 sctp_sendmsg(3SOCKET)