SCTP_SENDMSG(3SOCKET) | Sockets Library Functions | SCTP_SENDMSG(3SOCKET) |
sctp_sendmsg - send message from an SCTP socket
cc [ flag... ] file... -lsocket -lnsl -lsctp [ library... ] #include <sys/types.h> #include <sys/socket.h> #include <netinet/sctp.h> ssize_t sctp_sendmsg(int s, const void *msg, size_t len,
const struct sockaddr *to, socklen_t tolen, uint32_t ppid,
uint32_t flags, uint16_t stream_no, uint32_t timetolive,
uint32_t context);
The sctp_sendmsg() function sends a message from the SCTP endpoint s.
In addition to specifying msg as the message buffer and len as the length of the buffer, the following parameters can be set:
to
tolen
ppid
stream_no
timetolive
context
The flags parameter is formed from the bitwise OR of zero or more of the following flags:
MSG_UNORDERED
MSG_ABORT
MSG_EOF
MSG_PR_SCTP
MSG_PR_SCTP implements timed reliability service for SCTP messages. As yet, no common standard has been defined for the service and the interface is considered unstable.
The initial call to sctp_sendmsg() can be used to create an association, but it cannot be used subsequently on an existing association. Since sctp_sendmsg() always uses 0 internally as the association ID, it is not suitable for use on one-to-many sockets.
Upon successful completion, the sctp_sendmsg() function returns the number of bytes sent. The function returns -1 if an error occurs.
The sctp_sendmsg() function will fail if:
EBADF
ENOTSOCK
EOPNOTSUPP
EOPNOTSUPP
EPIPE
EAGAIN
ENOTCONN
EINVAL
EINVAL
EAFNOSUPPORT
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Committed |
MT-Level | Safe |
in.h(3HEAD), socket.h(3HEAD), libsctp(3LIB), accept(3SOCKET), bind(3SOCKET), connect(3SOCKET), listen(3SOCKET), sendmsg(3SOCKET), sockaddr(3SOCKET), socket(3SOCKET), sctp(4P), attributes(7)
August 22, 2007 | OmniOS |