sctp_send() Function
ssize_t sctp_send(s, *msg, len, *sinfo, flags); int s, const void *msg, size_t len, const struct sctp_sndrcvinfo *sinfo, int flags;
The sctp_send() function is usable by one-to-one and one-to-many sockets model. The sctp_send() function enables advanced SCTP features while sending a message from an SCTP endpoint.
-
s -
This value specifies the socket created by the
socket() function. -
msg -
This value contains the message sent by the
sctp_send() function. -
len -
This value is the length of the message. This value is expressed in bytes.
-
sinfo -
This value contains the parameters used to send the message. For a one-to-many sockets model, this value can contain the association ID to which the message is being sent.
-
flags -
This value is identical to the flags parameter in the
sendmsg() function.
The sctp_send() function returns the number of bytes it sent. The sctp_send() function returns -1 when an error occurs.
If the file descriptor passed in the s parameter is not valid, the sctp_send() function fails and sets the value of errno to EBADF. If the file descriptor passed in the s parameter does not describe a socket, the sctp_send() function fails and sets the value of errno to ENOTSOCK. If the sinfo_flags field of the sinfo parameter includes the value MSG_OOB, the sctp_send() function fails and sets the value of errno to EOPNOTSUPP. If the sinfo_flags field of the sinfo parameter includes the values MSG_ABORT or MSG_EOF for a one-to-one socket model, the sctp_send() function fails and sets the value of errno to EOPNOTSUPP. If there is no established association, the sctp_send() function fails and sets the value of errno to ENOTCONN. If the socket is shutting down, disallowing further writes, the sctp_send() function fails and sets the value of errno to EPIPE. If the socket is nonblocking and the transmit queue is full, the sctp_send() function fails and sets the value of errno to EAGAIN.
If the control message length is incorrect, the sctp_send() function fails and sets the value of errno to EINVAL. If the specified destination address does not belong to the association, the sctp_send() function fails and sets the value of errno to EINVAL. If the value of stream_no is outside the number of outbound streams that the association supports, the sctp_send() function fails and sets the value of errno to EINVAL. If the address family of the specified destination address is not AF_INET or AF_INET6, the sctp_send() function fails and sets the value of errno to EINVAL.