1

I am trying to send a message from Python code to C# via ZeroMQ. I am using the following data structure in Python:

message = msgpack.packb(
    (
        {"message_id": "1001", "type": "GET", "namespace": "DocumentManager"},
        "MdiActiveDocument",
        ["parameter1", "parameter2"]
    )
)
message = msgpack.packb(message)
alive_socket.send(message)

Trying to unpack it with C#, using this code:

        var message = new byte[500];
        int result = this.Client.Receive(message);
        var serializer = 
        MessagePackSerializer.Get<Tuple<Dictionary<string,string>, String, List<String>>>();
        var reply = serializer.UnpackSingleObject(message);

It results in this error:

Additional information: Unpacker is not in the array header.
The stream may not be array.

I have tried simplifying the data structure but I still cannot get it right. Perhaps my usage of MsgPack is flawed. Thanks in advance for any help.

Alex Bausk
  • 690
  • 5
  • 29

1 Answers1

0

Update: the real cause was much, much dumber than this explanation which I deleted. I called packb() twice in the original code.

Alex Bausk
  • 690
  • 5
  • 29