开发者

In Sockets, how to remove the length prefix in Socket Packet Protocol

开发者 https://www.devze.com 2023-03-11 15:02 出处:网络
Code-wise开发者_高级运维, how do you remove the length prefix in SocketPacketProtocol.cs for Nito.Async and/or PacketProtcol for ordinary Sockets?If your packets are fixed-size, then you can adapt Pac

Code-wise开发者_高级运维, how do you remove the length prefix in SocketPacketProtocol.cs for Nito.Async and/or PacketProtcol for ordinary Sockets?


If your packets are fixed-size, then you can adapt PacketProtocol very easily.

If this is not the case, you'll have to roll your own solution. Nito.Async heavily relies on a length prefix to build a packet out of several "fragmented receives". If your protocol relies on other packet-delimitation methods i.e special sequence value, you'll have to change a lot of code.

0

精彩评论

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

关注公众号