Homework 0 forum

ERROR: empty protobuf packet

Picture of Sacha Adrien Bartholmé
ERROR: empty protobuf packet
by Sacha Adrien Bartholmé - Tuesday, 29 September 2020, 14:35


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= -name=nodeA
  2. In a new shell, start netcat with nc -u 5000
  3. In the netcat subshell, type {"originPeerName":"sacha", "relayPeerAddr":"", "contents":"salut"} where 44825 is the port of the client
  4. The test binary outputs 

    ERROR: empty protobuf packet PEERS

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

Picture of Aaron Joos Lippeveldts
Re: ERROR: empty protobuf packet
by Aaron Joos Lippeveldts - Tuesday, 29 September 2020, 17:54

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

It works if you instead do

nc -u 5000