简体   繁体   English

Java SocketChannel读写关联

[英]Java SocketChannel write and read correlation

If a write(ByteBuffer) completes, does it mean that the other side has received the data. 如果write(ByteBuffer)完成,是否表示对方已接收到数据。 Would TCP ensure that the data would reach other side? TCP是否可以确保数据到达另一端?

No. It is only sure, that the data was written into the local socket buffer. 否。只能确定数据已写入本地套接字缓冲区。 But you cant assure that it will also be transmitted (network failure...). 但是您不能保证它也会被传输(网络故障...)。

  1. No. 没有。
  2. TCP will make its best endeavour. TCP将尽力而为。 You are guaranteed that if it arrives it will be intact and in the correct order up to the point of the final correctly executing receive. 您可以保证,如果到达,它将是完整无缺的,并且顺序正确,直到最终正确执行接收为止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM