sctp_sendmsg()
Send a message, using advanced SCTP features
Synopsis:
#include <netinet/sctp.h> ssize_t sctp_sendmsg(int s, const void *msg, size_t len, struct sockaddr *to, socklen_t tolen, uint32_t ppid, uint32_t flags, uint16_t stream_no, uint32_t timetolive, uint32_t context);
Arguments:
-
s
- Socket descriptor. msg
- Message to be sent. len
- Length of the message. to
- Destination address of the message. tolen
- Length of the destination address. ppid
- An opaque unsigned value that is passed to the remote end in each user message. The byte order issues are not accounted for and this information is passed opaquely by the SCTP stack from one end to the other. flags
-
Flags composed of bitwise OR of these values:
-
MSG_UNORDERED
- This flag requests the unordered delivery of the message. If the flag is clear, the datagram is considered an ordered send. MSG_ADDR_OVER
- This flag, in one-to-many style, requests the SCTP stack to override the primary destination address. MSG_ABORT
- This flag causes the specified association to abort -- by sending an ABORT message to the peer (one-to-many style only). MSG_EOF
- This flag invokes the SCTP graceful shutdown procedures on the specified association. Graceful shutdown assures that all data enqueued by both endpoints is successfully transmitted before closing the association (one-to-many style only).
Library:
libsctp
Use the -l sctp option to qcc to link against this library.
Description:
The sctp_sendmsg() function allows you to send extra information to a remote application. Using advanced SCTP features, you can send a message through a specified stream, pass extra opaque information to a remote application, or define a timeout for the particular message.
Returns:
The number of bytes sent, or -1 if an error occurs (errno is set).
Errors:
-
EBADF
- An invalid descriptor was specified. EDESTADDRREQ
- A destination address is required. EFAULT
- An invalid user space address was specified for a parameter. EMSGSIZE
- The socket requires that the message be sent atomically, but the size of the message made this impossible. ENOBUFS
- The system couldn't allocate an internal buffer. The operation may succeed when buffers become available. ENOTSOCK
- The argument s isn't a socket. EWOULDBLOCK
- The socket is marked nonblocking and the requested operation would block.
http://www.qnx.org/developers/docs/6.3.2/neutrino/lib_ref/s/sctp_sendmsg.html