0
我想设置SCTP_MAX_BURST使用下面的代码如何为关联设置SCTP_MAX_BURST?
struct sctp_assoc_value assocValue;
memset(&assocValue, 0, sizeof(assocValue));
assocValue.assoc_value = getMaxBurstValue();
setsockopt (fd, IPPROTO_SCTP, SCTP_MAX_BURST, &assocValue, sizeof (assocValue));
当我执行的代码,我收到以下错误: “没有这样的文件或目录”
谁能帮助我的可能原因为失败?
当我改变IPPROTO_SCTP到SOL_SOCKET,我没有得到任何错误,我打包设置值,getsockopt也显示我设置的任何值,但我不知道这是一个正确的方式setsockopt(FD, SOL_SOKCET,SCTP_MAX_BURST,&assocValue,sizeof(assocValue)); – jhon
@jhon,根据RFC 6458,套接字必须是多对一的风格: int sock = socket(AF_INET,SOCK_SEQPACKET,IPPROTO_SCTP); 并且它是一个SCTP级别的选项 int rc = setsockopt(sock,IPPROTO_SCTP,SCTP_MAX_BURST,&assocValue,sizeof(assocValue)); 通过选择不同的级别,您将获得一个SOL_SOCKET级别的选项,它恰好与SCTP级别的枚举具有相同的整数值。 –
- 在RFC 6458中提到它必须有很多才能设置MAX_BURST?我试图找出,但无法得到的? – jhon