WebServer icon indicating copy to clipboard operation
WebServer copied to clipboard

你好,请问一下如何确保数据发送完了?

Open grasslog opened this issue 6 years ago • 5 comments

grasslog avatar Jun 26 '19 01:06 grasslog

write/send结束就能确保数据发送完了。我猜你想问的是如何确保对方接收到数据?这个是需要应用层的回包来确认的哈

linyacool avatar Jun 28 '19 14:06 linyacool

那么,假设发送的数据很多。客户端如何确保数据发送/接受完了呢?

grasslog avatar Jun 28 '19 14:06 grasslog

应用层来保证,比如消息格式(比如我以某个特殊字符结束就表示我发完了,再比如我开头写一个64位的数字表示我数据包的长度,收满这么多就结束了)

linyacool avatar Jun 28 '19 14:06 linyacool

那个content-length表示的是什么呀?

grasslog avatar Jun 28 '19 15:06 grasslog

@grasslog 表示内容长度啊

linyacool avatar Jun 29 '19 02:06 linyacool