If the datagram or message is larger than the buffer supplied, the buffer is filled with the first part of the datagram and recv generates the error WSAEMSGSIZE. For unreliable protocols (for example, UDP), the excess data is lost; for reliable protocols, the data is retained by the service provider until it is successfully read by calling recv with a large enough buffer. 以上是MSDN对recv函数的解释,大体意思是:对于不可靠协议(如UDP),超出的部分将会被丢掉;而对于TCP则不会,数据会一直保存到被用户读完为止。所以你的程序是不是使用UDP协议啊?
For unreliable protocols (for example, UDP), the excess data is lost;
for reliable protocols, the data is retained by the service provider until it is successfully read by calling recv with a large enough buffer. 以上是MSDN对recv函数的解释,大体意思是:对于不可靠协议(如UDP),超出的部分将会被丢掉;而对于TCP则不会,数据会一直保存到被用户读完为止。所以你的程序是不是使用UDP协议啊?