请教下:用API函数做socker时,recv这个函数,在已经读完数据时,一直等在那里,怎么办。那句语句就一直在那执行,下面的语句都不执行了,退都退不出来了,直到连接的另一端断开连接为止,才执行下面的。我看MSDN帮助中的RECV函数发现他就有这点:If no incoming data is available at the socket, the recv call blocks and waits for data to arrive according to the blocking rules defined for WSARecv with the MSG_PARTIAL flag not set unless the socket is nonblocking. In this case, a value of SOCKET_ERROR is returned with the error code set to WSAEWOULDBLOCK。不知道大家有没有办法,能让他停止这种等待状态,或者说有什么方法在recv之前能检测下数据是否已经接收完了,然后就不调用recv函数了