标签:
client = accept(listener,(struct sockaddr *) &their_addr, &socklen); if(client < 0){ if(errno != EAGAIN && errno != ECONNABORTED && errno != EPROTO && errno != EINTR) perror("accept1"); continue; } char buf[100]; sprintf(buf,"accept from %s %d",inet_ntoa(their_addr.sin_addr),their_addr.sin_port); printf(" %s",buf); // accept from 192.168.31.112 7900
c socket server 获取client ip,port
标签:
原文地址:http://www.cnblogs.com/qk2015/p/4791095.html