linux 怎么判断socket接受缓存满了?

linux 怎么判断socket接受缓存满了


呼唤远方
浏览 2134回答 1
1回答

跃然一笑

int buflen = 65536*10;设置读缓存大小if(0!=setsockopt(m_sendUdpSock,SOL_SOCKET,SO_RCVBUF,&buflen,4)){return OS_ERROR;}设置写缓存大小if(0!=setsockopt(m_sendUdpSock,SOL_SOCKET,SO_SNDBUF,&buflen,4)){return OS_ERROR;}socklen_t getnumlen=4;读取写缓存大小if(0!=getsockopt(g_sendUdpSock,SOL_SOCKET,SO_RCVBUF,&buflen,&getnumlen)){printf("\n%s\n",strerror(errno));return OS_ERROR;
打开App,查看更多内容
随时随地看视频慕课网APP