getsockopt

getsockopt returns different IP_TOS value from the one set in setsockopt

岁酱吖の 提交于 2019-12-23 15:41:06
问题 I'm trying to use setsockopt to set IPTOS value to IPTOS_THROUGHPUT . The setsockopt call returned 0 . However the getsockopt shows the IP_TOS value is set to 1 , which is different from IPTOS_THROUGHPUT ( 0x8 ). Does anyone have idea what could have caused the mismatch of IPTOS value in the setsockopt and getsockopt ? Here's the log output: Set DSCP Marking on socket 26 setsockopt on socket 26 to 8 returns 0 DSCP marking on socket 26 is 1, different from expected 8 Below is the code: int

getsockopt “Invalid argument” for IPPROTO_SCTP, SCTP_STATUS

匆匆过客 提交于 2019-12-11 11:05:30
问题 Scenario: I've created SCTP one-to-many socket (functions that starts with big letter call corresponding standard functions with check for error and print errno to stderr) int sock_fd,msg_flags; char readbuf[BUFFSIZE]; struct sockaddr_in servaddr, cliaddr; struct sctp_sndrcvinfo sri; struct sctp_event_subscribe evnts; int stream_increment=1; socklen_t len; size_t rd_sz; sock_fd = Socket( AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP); bzero( &servaddr, sizeof( servaddr)); servaddr.sin_family = AF