服务端:
struct sockaddr_in their_addr;
sin_size = sizeof(struct sockaddr_in);
SOCKET skt_tmp;
skt_tmp= accept(skt, (struct sockaddr *)&their_addr, &sin_size);
&their_addr 里面存放了客户端的IP和端口
struct sockaddr_in their_addr;
sin_size = sizeof(struct sockaddr_in);
SOCKET skt_tmp;
skt_tmp= accept(skt, (struct sockaddr *)&their_addr, &sin_size);
&their_addr 里面存放了客户端的IP和端口