memoriesadrift / tuw-cryptocurrencies-blockchain

Blockchain created for the Cryptocurrencies course at TU Wien
0 stars 0 forks source link

T1: Message Edge Cases #11

Closed memoriesadrift closed 11 months ago

memoriesadrift commented 11 months ago

Description

Note that a single message may get split across different packets, e.g. you may receive "type":"ge and tpeers" in separate messages. So you should defragment such JSON strings. Alternatively, a single packet could contain multiple messages (separated by "\n") and your node should be able to separate them. Note that JSON strings you receive may not be in canonical form, but they are valid messages nevertheless.

Scope

memoriesadrift commented 11 months ago

Leaving this open for now as I don't think messages are being handled in correct order. I will get to it after handshakes work

memoriesadrift commented 11 months ago

New: Ensure each message we send ends in a newline