开发者

Create TCP Packet in C#

开发者 https://www.devze.com 2022-12-19 17:47 出处:网络
I\'m开发者_运维百科 sending data to an extremely old system via TCP. I need to send 2000 bytes in one packet, and I need it not to be split up (what happens when I write out 2000 bytes via a socket).

I'm开发者_运维百科 sending data to an extremely old system via TCP. I need to send 2000 bytes in one packet, and I need it not to be split up (what happens when I write out 2000 bytes via a socket).

While, yes, I shouldn't have to care about this at an application level -- I in fact do care about this, because I have no other options on the older system, everything MUST be received in a single packet.

Is there something less terrible than calling netcat?


Unless you are on a link with jumbo frames the usual MTU on the ethernet is 1500. Subtract IP (20 bytes) and TCP headers (at least 20 bytes). So no luck with 2000 bytes in a single packet.

0

精彩评论

暂无评论...
验证码 换一张
取 消