由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 研讨一下TCP fragment的问题
相关主题
各位所在公司的code review烦人不?Linux Socket编程
发现ramdisk不错,多个进程通信用文件就可以了,简单问个关于socket问题
vert.x+swift是开发下一个generation的app的最捷径问个socket close的问题
gss_wrap token sizeAn interview project: asynchronous socket programming
怎样高效管理内存?C++网络编程问题
socket re-connection problem求建议:C++的TCP/IP编程库
Help: Socket.SendFile() cannot be recognized by c# compilerSocket accept failed - WSAEMFILE
初级socket问题Intel为什么选用little endian? (转载)
相关话题的讨论汇总
话题: tcp话题: send话题: recv话题: socket话题: bytes
进入Programming版参与讨论
1 (共1页)
h**********c
发帖数: 4120
1
tcp 怎么会有fragment呢?
有什么文献看吗?RFC?
有什么套路没有?
举个例子,还真碰到一次,
send 488 bytes
服务器受到484
再收到4
这是个cs问题,ce问题,还是ee 问题?
j*****k
发帖数: 1198
2
check data communication

【在 h**********c 的大作中提到】
: tcp 怎么会有fragment呢?
: 有什么文献看吗?RFC?
: 有什么套路没有?
: 举个例子,还真碰到一次,
: send 488 bytes
: 服务器受到484
: 再收到4
: 这是个cs问题,ce问题,还是ee 问题?

p***o
发帖数: 1252
3
That's socket programming 101: STREAM socket vs. DATAGRAM socket .

【在 h**********c 的大作中提到】
: tcp 怎么会有fragment呢?
: 有什么文献看吗?RFC?
: 有什么套路没有?
: 举个例子,还真碰到一次,
: send 488 bytes
: 服务器受到484
: 再收到4
: 这是个cs问题,ce问题,还是ee 问题?

h**********c
发帖数: 4120
4
用的openssl biosocket,参考上明确的说是tcp,
另外apache mina介绍codecfactory明确说过tcp会有fragments,但是讲得也不详细。
有什么参考介绍一下吧。

【在 p***o 的大作中提到】
: That's socket programming 101: STREAM socket vs. DATAGRAM socket .
p***o
发帖数: 1252
5
Any book on networking/socket programming would mention in the very
beginning that TCP is stream socket. In other words, you get a stream
of bytes, no more and no less. A send() is not guaranteed to send all
the bytes you attempt to write and a recv() is not guaranteed to receive
all the bytes you attempt to read. So you could send 100 bytes at one
end and recv() would return twice, 50 bytes each, at the other end.
For reference, check Unix Network Programming, Volume 1.

【在 h**********c 的大作中提到】
: 用的openssl biosocket,参考上明确的说是tcp,
: 另外apache mina介绍codecfactory明确说过tcp会有fragments,但是讲得也不详细。
: 有什么参考介绍一下吧。

h**********c
发帖数: 4120
6
thanks,
有机会找这本书看看,
看别的谈上讲tcp mss,不知道socket初始的时候能调整不

【在 p***o 的大作中提到】
: Any book on networking/socket programming would mention in the very
: beginning that TCP is stream socket. In other words, you get a stream
: of bytes, no more and no less. A send() is not guaranteed to send all
: the bytes you attempt to write and a recv() is not guaranteed to receive
: all the bytes you attempt to read. So you could send 100 bytes at one
: end and recv() would return twice, 50 bytes each, at the other end.
: For reference, check Unix Network Programming, Volume 1.

p***o
发帖数: 1252
7
TCP application should work correctly no matter how MSS is set.
MSS may affect performance though I don't think that's your
concern at this stage.

【在 h**********c 的大作中提到】
: thanks,
: 有机会找这本书看看,
: 看别的谈上讲tcp mss,不知道socket初始的时候能调整不

h**********c
发帖数: 4120
8
my think is based on reasoning not on staging, period.
tcp may stop send while the peer buffer is full. so it still needs application layer to establish the correct send/recv operations. that is why I raised this question here. It is good to have some examples, e.g. net ant, bit torrent. But I don't want to read those big projects. May sb got some short concise code example.

【在 p***o 的大作中提到】
: TCP application should work correctly no matter how MSS is set.
: MSS may affect performance though I don't think that's your
: concern at this stage.

t****t
发帖数: 6806
9
just as pp2 said, send() is not guaranteed to send full request and recv()
is not guaranteed to receive full request. always check the return value and
assemble the request/result appropriately , you should be fine.

application layer to establish the correct send/recv operations. that is why
I raised this question here. It is good to have some examples, e.g. net ant
, bit torrent. But I don't want to read those big projects. May sb got some
short concise code example.

【在 h**********c 的大作中提到】
: my think is based on reasoning not on staging, period.
: tcp may stop send while the peer buffer is full. so it still needs application layer to establish the correct send/recv operations. that is why I raised this question here. It is good to have some examples, e.g. net ant, bit torrent. But I don't want to read those big projects. May sb got some short concise code example.

p***o
发帖数: 1252
10
Most socket programming books answer your questions in the very
first few chapters. Do your own homework.

application layer to establish the correct send/recv operations. that is why
I raised this question here. It is good to have some examples, e.g. net ant
, bit torrent. But I don't want

【在 h**********c 的大作中提到】
: my think is based on reasoning not on staging, period.
: tcp may stop send while the peer buffer is full. so it still needs application layer to establish the correct send/recv operations. that is why I raised this question here. It is good to have some examples, e.g. net ant, bit torrent. But I don't want to read those big projects. May sb got some short concise code example.

1 (共1页)
进入Programming版参与讨论
相关主题
Intel为什么选用little endian? (转载)怎样高效管理内存?
The WhatsApp Architecturesocket re-connection problem
C10M 练习2: 空TCP 连接,1M per 4G RAMHelp: Socket.SendFile() cannot be recognized by c# compiler
C10M除了socket以外,还牵涉其他方面的技巧初级socket问题
各位所在公司的code review烦人不?Linux Socket编程
发现ramdisk不错,多个进程通信用文件就可以了,简单问个关于socket问题
vert.x+swift是开发下一个generation的app的最捷径问个socket close的问题
gss_wrap token sizeAn interview project: asynchronous socket programming
相关话题的讨论汇总
话题: tcp话题: send话题: recv话题: socket话题: bytes