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