I Have a simple class with two fields in proto file: (proto3)
enum MaestroMsgType
{
EVAL = 0;
GET_ACK = 1;
GET_AN = 2;
}
message MaestroMsg
{
MaestroMsgType msgType = 1;
string maestroMsg = 2;
}
I'm trying to send (with netMQ but that less matter) the class form C# to python. But in python when trying to make the data back into class format it fails.
The sending in C#:
MaestroMsg maestroMsg = new MaestroMsg
{
MaestroMsg_ = "someMessage",
MsgType = MaestroMsgType.GET_AN,
};
string messageToSend = maestroMsg.ToString();
NetMQMessage msg = new NetMQMessage();
msg.Append(messageToSend);
_pubSocket.SendMultipartMessage(msg);
The code in python receiving the message:
received_message = sub_socket.recv_multipart()
maestroMsg_object = MaestroMsg()
maestroMsg_object.ParseFromString(received_message.encode())
And I get this error message:
google.protobuf.message.DecodeError: Error parsing message
I got no idea what I'm doing wrong. Thanks for answers.