The sctp_sendmsg() function enables advanced SCTP features while sending a message from an SCTP endpoint.
This value specifies the SCTP endpoint that is sending the message.
This value contains the message sent by the sctp_sendmsg() function.
This value is the length of the message. This value is expressed in bytes.
This value is the destination address of the message.
This value is the length of the destination address.
This value is the application-specified payload protocol identifier.
This value is the target stream for this message.
This value is the time period after which the message expires if it has not been successfully sent to the peer. This value is expressed in milliseconds.
This value is returned if an error occurs during the sending of the message.
This value is formed from applying the logical operation OR in bitwise fashion on zero or more of the following flag bits:
When this flag is set, the sctp_sendmsg() function delivers the message unordered.
When this flag is set, the sctp_sendmsg() function uses the address in the to parameter instead of the association's primary destination address. This flag is only used with one-to-many style SCTP sockets.
When this flag is set, the specified association aborts by sending an ABORT signal to its peer. This flag is only used with one-to-many style SCTP sockets.
When this flag is set, the specified association enters graceful shutdown. This flag is only used with one-to-many style SCTP sockets.
When this flag is set, the message expires when its transmission has not successfully completed within the time period specified in the timetolive parameter.
The sctp_sendmsg() function returns the number of bytes it sent. The sctp_sendmsg() function returns -1 when an error occurs.
If the file descriptor passed in the s parameter is not valid, the sctp_sendmsg() 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_sendmsg() function fails and sets the value of errno to ENOTSOCK. If the flags parameter includes the value MSG_OOB, the sctp_sendmsg() function fails and sets the value of errno to EOPNOTSUPP. If the flags parameter includes the values MSG_ABORT or MSG_EOF for a one-to-one style socket, the sctp_sendmsg() function fails and sets the value of errno to EOPNOTSUPP. If there is no established association, the sctp_sendmsg() function fails and sets the value of errno to ENOTCONN. If the socket is shutting down, disallowing further writes, the sctp_sendmsg() function fails and sets the value of errno to EPIPE. If the socket is nonblocking and the transmit queue is full, the sctp_sendmsg() function fails and sets the value of errno to EAGAIN.
If the control message length is incorrect, the sctp_sendmsg() function fails and sets the value of errno to EINVAL. If the specified destination address does not belong to the association, the sctp_sendmsg() 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_sendmsg() 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_sendmsg() function fails and sets the value of errno to EINVAL.