ERROR: empty protobuf packet

ERROR: empty protobuf packet

par Sacha Adrien Bartholmé,
Nombre de réponses : 1

Hello,

When my binary sends an UDP packet to the provided test binary via the Gossip Port, the test binary prints "ERROR: empty protobuf packet".

Here are the steps to reproduce the error:

  1. Start the test binary with  ./hw0 -UIPort=10000 -gossipAddr=127.0.0.1:5000 -name=nodeA
  2. In a new shell, start netcat with nc -u 127.0.0.1 5000
  3. In the netcat subshell, type {"originPeerName":"sacha", "relayPeerAddr":"127.0.0.1:44825", "contents":"salut"} where 44825 is the port of the client
  4. The test binary outputs 

    ERROR: empty protobuf packet PEERS 127.0.0.1:4482


    When I do the same with my own binary I do not have this problem.

En réponse à Sacha Adrien Bartholmé

Re: ERROR: empty protobuf packet

par Aaron Joos Lippeveldts,

You're sending a bare SimpleMessage, instead of one wrapped in a SimplePacket (see packets.go).

It works if you instead do

nc -u 127.0.0.1 5000

{"simple":{"originPeerName":"sacha","relayPeerAddr":"127.0.0.1:44825","contents":"salut"}}