Open lgrahl opened 7 years ago
I thought about add a socket option using IPPROTO_SCTP
as its level and SCTP_GET_NXT_INFO
as its name and using
struct sctp_nxtinfo {
uint16_t nxt_sid;
uint16_t nxt_flags;
uint32_t nxt_ppid;
uint32_t nxt_length;
sctp_assoc_t nxt_assoc_id;
};
as its value, which is already defined in RFC6458. This could only be used with getsockopt()
.
The only thing I'm not sure about is how to handle the case where no next message is queued. Returning -1 from getsockopt()
and setting errno
to EAGAIN
is something I want to avoid. So I think it might be good to define a constant SCTP_NO_MESSAGE
which is used in nxt_flags
. Any opinion on that?
Fine by me. I agree that getsockopt should not return -1 in case no message is available.
It has been a year now. :) Any update?
When using the upcall handler, we need to use
usrsctp_recvv
to retrieve the next message once theSCTP_EVENT_READ
has been raised. In order to optimise memory allocation, can we get a function that returns the size of the message we would receive in the nextusrsctp_recvv
call?Something like this: