netsec-ethz/rains

CBOR: encode then write

Opened this issue · 1 comments

Please note that in the current SCION UDP implementation, we are marshaling the RAINS message first then writing it at once to the connection object. This is because if we use the connection as a io.Writer and pass that in to the CBOR library, eliminating the buffer, then parts of the message get written to the underlying transport one by one.

The effect of this in a UDP setting is that the message gets split up over multiple UDP packets, and the receiver then cannot make sense of the received data because (my guess is) there is no logic to wait for more data on the UDP stream maybe?

The associated PR which does this for the ZonePublisher is #199