简体   繁体   中英

Java SocketChannel write and read correlation

If a write(ByteBuffer) completes, does it mean that the other side has received the data. Would TCP ensure that the data would reach other side?

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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