阅读背景:

使用TCP时是否需要使用校验和来保护消息?

来源:互联网 

Using TCP as the network protocol, I prefix the size (and potentially checksum?) of each message before sending the message through the wire. I'd like to know, does it make sense to calculate and transmit the checksum of the message, to ensure that the message will be delivered (if and when it will be delivered) unchanged, e.g. because of some network error. Currently I'm sending 4-byte size + 2-byte checksum (CRC-16) of the message, before sending the message itself. The other endpoint correctly identifies expected message length, reads it, and validates the checksum.Using TCP as the network protocol, I prefix the




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: