nanomsg / nng

nanomsg-next-generation -- light-weight brokerless messaging
https://nng.nanomsg.org
MIT License
3.63k stars 472 forks source link

Will the NNG framework built-in handle packet splitting and sticking issues during streaming transmission? #1839

Closed louislau86 closed 3 weeks ago

louislau86 commented 4 weeks ago

In the message structure defined internally in NNG, I see fields for message header length and message body length. What I want to know is whether NNG has utilized these length fields to determine the integrity of packet reception, which is used to solve possible packet splitting and sticking problems during streaming transmission, so as to avoid dealing with these problems in applications using NNG?

gdamore commented 3 weeks ago

If you are using SP protocols such as req rep or pub sub then yes the messages are framed properly in transit on the wire. The receiver will only see complete messages.

The entire api is message oriented and the transports ensure you will only ever interact with a complete message.

louislau86 commented 3 weeks ago

@gdamore Thanks for your response. And sorry to request more information about NNG, are all the protocols and communication modes in NNG support these feature? Users don't need to process the packet integrity?