- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我有一个关于 TCP 段重组的问题。我了解到数据包可以分为多个段(这与 MSS 有关)。
即)消息流(假设):
我的理解是 TCP 层是分割的段重新组合的地方。如果我错了,请纠正我。
这是我真正想澄清的事情。
当使用 Netty 时,服务器端的“messageReceived()”方法只被调用一次还是 3 次?如果 TCP 层是重新组合分割段的地方,则“messageReceived()”方法只被调用一次,对吗?
那么,真的有必要使用“ReplayingDecoder”之类的东西来保证服务器接收的字节数吗?
非常感谢您的帮助。
附加问题:
如果服务器因为其中一个丢失或其他原因无法重新组装这些段,那么 TCP 层会将不完整的数据包传递给应用层?
最佳答案
the packet could be divided into multiple segments
上下颠倒,或错误的术语。 TCP 发送分段,这些分段被分成数据包,并且可能在途中进一步拆分为子数据包。
My understanding is that the TCP layer is where divided segments get reassembled.
数据包重组发生在 IP 层,而不是应用程序(或 TCP 层)。段重组发生在 TCP 层。
"messageReceived()" method gets called only one or 3 times?
它被调用从 1 到 N 的任意次数,其中 N 是字节流的长度。发送方发送和接收方接收之间不能保证 1::1 对应。
If the server fails to reassemble the segments because one of them is lost or something, then the TCP layer pass the incomplete packet to the application layer?
绝对不是。 TCP 根本不将数据包传递给应用层。它传递一个完整的、正确排序的字节流,或者什么都不传递。
Wondering if i should handle the segment reassembly by myself
您不会,也不能自己处理任何事情。 TCP 向应用程序提供字节流,而不是段或数据包。
关于sockets - 网络 : does it need to care TCP segments reassembly?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14834602/
这是一个糟糕的模式。 copy-and-swap 更好。 foo & operator = ( foo const & other ) { static_assert ( noexcept(
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
关于 PyCharm 和警告的帖子和问题太多了,但对于 PyCharm 何时真正告诉您一些有用的东西以及何时没有,尤其是关于“预期类型”警告,似乎几乎没有达成共识。我发现,发布到 IntelliJ/P
我想我理解 Fischer & Paterson 算法与此处显示的“无关”模式匹配: http://u.cs.biu.ac.il/~amir/AlgII/fp-set1.html 但是,据我了解,可以
所以我遇到了 Exception in thread "Thread-0" java.lang.IllegalArgumentException: Unknown type: null at
我有一个不寻常的排序案例,我的谷歌搜索几乎没有出现。以下是参数: 1)随机访问容器。 (C++ vector ) 2) 一般小 vector 尺寸(少于32个对象) 3) 许多对象彼此之间具有“无关”
这个问题在这里已经有了答案: How can I assign a "don't care" value to an output in a combinational module in Veril
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我了解各种可能的移动开发平台。不过,我很想知道您能告诉我有关 Qualcomm BREW 的什么信息吗?为什么现在还有人关心它?我的意思是,有了 J2ME 的可移植性(中高级设备中对 J2ME 的兴趣
我需要搜索字符串上的子字符串。诀窍是:- 这是我不关心的一封信。- 这封信中必须有一个字母,但哪个字母并不重要。- 字母是“I”,所以 因此,例如与字符串相比时的子“MQINEEIR”: - "MQI
我有一个特性,可以为微 Controller 指定允许的引脚配置: pub trait TimChannelsMapping: Sized { const MAPPING: u8; } 它是这
有没有办法在嵌套列表中查找特定值而不关心其余值的情况下使用 count()? lst = [[1,6],[1,4],[3,4],[1,2]] X = 1 lst.count([X, _ ]) 这将返回
我有一组位模式,想在该组中找到与给定输入匹配的元素的索引。位模式包含“无关”位,即匹配 0 和 1 的 x-es。 例子位模式集是 index abcd 0 00x1 1 01xx
在类里面,我们现在正在学习如何构建 Spring 应用程序,尽管 Spring 没有直接参与,但我们学习了如何为 DAO 和服务层对象制作接口(interface)。 如果我错了,请纠正我:DAO 层
是否可以在 Kotlin 中标记“不关心”?我无法找到合适的语法,Haskell 和 Python 使用 _ 符号,但这在 Kotlin 中不起作用。 示例, data class DesugarEx
我有一条名为 input 的电线,我想检测前导的数量我正在尝试创建一个模块,该模块使用下面的 case 语句根据前导零的数量更改输出数据。然而,输入的大小是可参数化的。 如果 X 是固定值 4,我将只
我遇到以下错误消息: 1. byobu ERROR: Sessions should be nested with care. Unset $TMUX to force. 某些版本会显示警告而不是错误
我正在尝试修剪数字 (0-9) 的骨架化图像,由于原始数字厚度的不规则性,该图像有时会高度分支。 为此,我尝试使用图 4 中所示的内核:http://homepages.inf.ed.ac.uk/rb
我正在尝试创建一个简单的数据类型,用作 Numpy 数组的 dtype,我可以在其上执行元素明智的加法、减法和比较。该类型应具有(至少)三个值,分别表示真、假和“无关”(DC)。后者等于 true 和
我有一个相当大的集合,包含 n 个具有整数坐标(d 大约为 50)的 d 维向量,除了在某些情况下坐标是一个特殊的标记“无关”值,我将用*。我正在尝试找到一种有效的算法,用于将所有相互比较相等的向量合
我是一名优秀的程序员,十分优秀!