Is there a way to receive multiple messages in a single system call using a SctpStream?

475 Views Asked by At

I want to receive multiple messages from a SctpStream in a single system call. My goal is to know the number of bytes received every time I make a receive call.

The Linux socket function recvmmsg returns multiple messages:

int recvmmsg(int sockfd, struct mmsghdr *msgvec, unsigned int vlen,
                unsigned int flags, struct timespec *timeout);
DESCRIPTION         
The recvmmsg() system call is an extension of recvmsg(2) that allows
the caller to receive multiple messages from a socket using a single
system call. ...

I tried reading the socket buffer but it always returns 0 bytes. Does this mean that EOF has been reached? I tried sending different number of packets and the buffer is also very large. Still I always get 0 as the number of bytes returned. I am receiving the packets; transmission is not a problem here.

0

There are 0 best solutions below