5373 connect(3SOCKET) could talk about non-blocking mode
[unleashed.git] / usr / src / man / man3socket / sctp_send.3socket
blob3a44106596c91adf6f8701ecf00fc8c94e4478e7
1 '\" te
2 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH SCTP_SEND 3SOCKET "Mar 19, 2004"
7 .SH NAME
8 sctp_send \- send message from an SCTP socket
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lsocket\fR \fB -lnsl \fR \fB -lsctp \fR [ \fIlibrary\fR... ]
13 #include <sys/types.h>
14 #include <sys/socket.h>
15 #include <netinet/sctp.h>
17 \fBssize_t\fR \fBsctp_send\fR(\fBint\fR \fIs\fR, \fBconst void *\fR\fImsg\fR, \fBsize_t *\fR\fIlen\fR,
18      \fBconst struct sctp_sndrcvinfo *\fR\fIsinfo\fR, \fBint\fR \fIflags\fR);
19 .fi
21 .SH DESCRIPTION
22 .LP
23 The \fBsctp_send()\fR function sends messages from one-to-one and one-to-many
24 style SCTP endpoints. The following parameters can be set:
25 .sp
26 .ne 2
27 .na
28 \fB\fIs\fR\fR
29 .ad
30 .RS 7n
31 Socket created by \fBsocket\fR(3SOCKET)
32 .RE
34 .sp
35 .ne 2
36 .na
37 \fB\fImsg\fR\fR
38 .ad
39 .RS 7n
40 Message to be sent
41 .RE
43 .sp
44 .ne 2
45 .na
46 \fB\fIlen\fR\fR
47 .ad
48 .RS 7n
49 Size of the message to be sent in bytes
50 .RE
52 .sp
53 .LP
54 The caller completes the \fIsinfo\fR parameter with values used to send a
55 message. Such values might include the stream number, payload protocol
56 identifier, time to live, and the SCTP message flag and context. For a
57 one-to-many socket, the association ID can be specified in the \fIsinfo\fR
58 parameter to send a message to the association represented in the ID.
59 .sp
60 .LP
61 Flags supported for \fBsctp_send()\fR are reserved for future use.
62 .SH RETURN VALUES
63 .LP
64 Upon successful completion, the \fBsctp_send()\fR function returns the number
65 of bytes sent. The function returns \fB-1\fR if an error occurs.
66 .SH ERRORS
67 .LP
68 The \fBsctp_send()\fR function fails under the following conditions.
69 .sp
70 .ne 2
71 .na
72 \fB\fBEBADF\fR\fR
73 .ad
74 .RS 16n
75 The \fIs\fR argument is an invalid file descriptor.
76 .RE
78 .sp
79 .ne 2
80 .na
81 \fB\fBENOTSOCK\fR\fR
82 .ad
83 .RS 16n
84 The \fIs\fR argument is not a socket.
85 .RE
87 .sp
88 .ne 2
89 .na
90 \fB\fBEOPNOTSUPP\fR\fR
91 .ad
92 .RS 16n
93 \fBMSG_ABORT\fR or \fBMSG_EOF\fR is set in the \fBsinfo_flags\fR field of
94 \fBsinfo\fR for a one-to-one style SCTP socket.
95 .RE
97 .sp
98 .ne 2
99 .na
100 \fB\fBEPIPE\fR\fR
102 .RS 16n
103 The socket is shutting down and no more writes are allowed.
107 .ne 2
109 \fB\fBEAGAIN\fR\fR
111 .RS 16n
112 The socket is non-blocking and the transmit queue is full.
116 .ne 2
118 \fB\fBENOTCONN\fR\fR
120 .RS 16n
121 There is no established association.
125 .ne 2
127 \fB\fBEINVAL\fR\fR
129 .RS 16n
130 Control message length is incorrect.
134 .ne 2
136 \fB\fBEINVAL\fR\fR
138 .RS 16n
139 Specified destination address does not belong to the association.
143 .ne 2
145 \fB\fBEINVAL\fR\fR
147 .RS 16n
148 The \fBstream_no\fR is outside the number of outbound streams supported by the
149 association.
153 .ne 2
155 \fB\fBEAFNOSUPPORT\fR\fR
157 .RS 16n
158 Address family of the specified destination address is other than \fBAF_INET\fR
159 or \fBAF_INET6\fR.
162 .SH ATTRIBUTES
164 See \fBattributes\fR(5) for descriptions of the following attributes:
169 box;
170 c | c
171 l | l .
172 ATTRIBUTE TYPE  ATTRIBUTE VALUE
174 Interface Stability     Evolving
176 MT-Level        Safe
179 .SH SEE ALSO
181 \fBaccept\fR(3SOCKET), \fBbind\fR(3SOCKET), \fBconnect\fR(3SOCKET),
182 \fBin.h\fR(3HEAD), \fBlibsctp\fR(3LIB), \fBlisten\fR(3SOCKET),
183 \fBsctp_sendmsg\fR(3SOCKET), \fBsendmsg\fR(3SOCKET), \fBsocket\fR(3SOCKET),
184 \fBsocket.h\fR(3HEAD), \fBsctp\fR(7P)