nRet = sctp_recvmsg(SCTPSock, szBuf, &buflen,
			 (sockaddr*)&msgname, &msgname_len,
			 &tSCTPSndRcvInfo, &msg_flags);
if( nRet == -1 ){
		perror(NULL);
		return -1;
}
switch(tSCTPSndRcvInfo.sinfo_stream){
 ...
}

Example 2: Using sctp_recvmsg() to get the virtual stream associated with the data message.

Back to Article