Java 套接字何时发送 ack? [英] When does a Java socket send an ack?

查看:29
本文介绍了Java 套接字何时发送 ack?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是当接收端的套接字发送 ack 时?是应用程序读取socket数据时还是底层获取数据放入缓冲区?

My question is that when a socket at the receiver-side sends an ack? At the time the application read the socket data or when the underlying layers get the data and put it in the buffer?

我想要这个是因为我想让双方的应用程序都知道对方是否接受了数据包.

I want this because I want both side applications know whether the other side took the packet or not.

推荐答案

TCP ACK 旨在确认传输层而非应用层上的 TCP 数据包.只有您的应用程序可以明确表示它也已处理来自缓冲区的数据.

TCP ACKs are meant to acknowledge the TCP packets on the transmission layer not the application layer. Only your application can signal explicitly that it also has processed the data from the buffers.

这篇关于Java 套接字何时发送 ack?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆