mwbr.net
当前位置:首页 >> sEtsoCkopt rEusEADDr >>

sEtsoCkopt rEusEADDr

//设置套接字选项为SO_REUSEADDR,即socket可重用int opt=1;setsockopt(listenfd,SOL_SOCKET,SO_REUSEADDR,&opt,sizeof(opt));

self.__socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self.__socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)这种情况下,就...

fgfvvfvvfvfvfg

int reuse = 1; setsockopt(sockfd,SOL_SOCKET,SO_REUSEADDR,&reuse);//设置套接字属性为重用bind地址,

setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));memset(&servaddr, 0, sizeof(struct sockaddr_in));port = atoi(argv[1]);servaddr...

网站首页 | 网站地图
All rights reserved Powered by www.mwbr.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com