{ ...... while (1) { recv(socket,buffer,sizeof(buffer),0); ...... } close(socket); }
因为线程在recv()调用时阻塞,我怎么能让线程正常退出?
shutdown(sock,SHUT_RDWR) //on the remote end
检查this.