setsockopt 的原型是:
int setsockopt(int socket, int level, int option_name, const void *option_value, socklen_t option_len);
以下都是正确的吗?哪些不是?
一个。)
int buffsize = 50000;
setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&buffsize, sizeof(buffsize));
b.)
int buffsize = 50000;
setsockopt(s, SOL_SOCKET, SO_RCVBUF, (void *)&buffsize, sizeof(buffsize));
C。)
char *buffsize = "50000";
setsockopt(s, SOL_SOCKET, SO_RCVBUF, buffsize, strlen(buffsize));
d.)
setsockopt(s, SOL_SOCKET, SO_RCVBUF, "50000", 5);