sctp_recvmsg
![]() |
![]() |
![]() |
![]() |
sctp_recvmsg()
Receive a message, using advanced SCTP features
Synopsis:
#include <netinet/sctp.h>
ssize_t sctp_recvmsg(int s,
void *msg,
size_t len,
struct sockaddr *from,
socklen_t *fromlen,
struct sctp_sndrcvinfo *sinfo,
int *msg_flags);
Arguments:
- s
- Socket descriptor.
- msg
- Message buffer to be filled.
- len
- Length of the message buffer.
- from
- A pointer to a sockaddr object where the function can store the source address of the message.
- fromlen
- A pointer to a socklen_t object that specifies the size of the from buffer. The function stores the actual size of the address in this object.
- sinfo
- A pointer to a sctp_sndrcvinfo structure to be filled upon receipt of the message.
- msg_flags
- A pointer to an integer to be filled with any message flags (e.g. MSG_NOTIFICATION).
Library:
libsctp
Use the -l sctp option to qcc to link against this library.
Description:
The sctp_recvmsg() function receives a message from socket s, whether or not a socket is connected. The difference between this function and the generic function, recvmsg(), is that you can pass in a pointer to a sctp_sndrcvinfo structure, and the structure is filled upon receipt of the message. The structure has detailed information about the message you just received.
![]() |
You must enable sctp_data_io_events with the SCTP_EVENTS socket option first, to be able to have the sctp_sndrcvinfo structure be filled in. |
Returns:
The number of bytes received, or -1 if an error occurs (errno is set).
Errors:
- ENOMEM
- Not enough stack memory.
Classification:
| Safety: | |
|---|---|
| Cancellation point | Yes |
| Interrupt handler | No |
| Signal handler | No |
| Thread | Yes |
See also:
SCTP, sctp_bindx(), sctp_connectx(), sctp_freeladdrs(), sctp_freepaddrs(), sctp_getladdrs(), sctp_getpaddrs(), sctp_peeloff(), sctp_sendmsg()
![]() |
![]() |
![]() |
![]() |
![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)
