1、udp
linux client:send send data len
linux server:recv recv data len
当 send len <= recv len时,recv接受正常;
当 send len > recv len时,recv接受 recv data len,也就是说只接收recv buf len个数据,其余数据没有接收;
while循环,发现接下来的recv 居然没有继续接收剩下的数据,而是接收send发来的新的数据,也就是说上一次没有接收的数据,被udp给舍弃了。
在udp broadcast情况下,udp recv也是这样的。
2、tcp
windows client:send send data len
windows server:recv recv data len
当 send len <= recv len时,recv接受正常;
当 send len > recv len时,recv接受 recv data len,也就是说只接收recv buf len个数据,其余数据没有接收;
while循环,发现接下来的recv 居然继续接收剩下的数据,直到接受完成。之后,recv才继续send发来的新的数据,也就是说上一次没有接收的数据,没有被tcp舍弃。
linux client:send send data len
linux server:recv recv data len
当 send len <= recv len时,recv接受正常;
当 send len > recv len时,recv接受 recv data len,也就是说只接收recv buf len个数据,其余数据没有接收;
while循环,发现接下来的recv 居然没有继续接收剩下的数据,而是接收send发来的新的数据,也就是说上一次没有接收的数据,被udp给舍弃了。
在udp broadcast情况下,udp recv也是这样的。
2、tcp
windows client:send send data len
windows server:recv recv data len
当 send len <= recv len时,recv接受正常;
当 send len > recv len时,recv接受 recv data len,也就是说只接收recv buf len个数据,其余数据没有接收;
while循环,发现接下来的recv 居然继续接收剩下的数据,直到接受完成。之后,recv才继续send发来的新的数据,也就是说上一次没有接收的数据,没有被tcp舍弃。