I mostly have everything working for my current project but I have another more evasive issue linked to how streaming is done.
That's the third language I port our communication library on and here is how it works on the other two (for one of them I also wrote the messagepack encoder/decoder the other I just based my work on an existing messagepack library):
Data arrive on a tcp socket, depending on the size it can either be received as one packet or multiple, the messagepack decoder read incoming data as it arrive and when it has a full "message" in the messagepack sense it calls a user method to deal with it.
I tried two methods (both in a separate, dedicated thread):
- call MessagePackSerializer.Deserialize<object[]>(stream);: the result is that it simply hangs when I use a network stream, from the code I suppose it will never return unless the stream is closed...
- call MessagePackSerializer.Deserialize<object[]>(stream, MyResolver.instance, true); to try the strict mode (I am not sure what it means but I was stuck anyway), this works for simple case where the packet is received as one but otherwise the library starts decoding the content without having every bytes which cause various horrible crashes.
The problem I have with this library is that it does not really have a streaming api, that's not necessarly a blocking issue but how would you handle my usecase ?
Reactions are currently unavailable
I mostly have everything working for my current project but I have another more evasive issue linked to how streaming is done.
That's the third language I port our communication library on and here is how it works on the other two (for one of them I also wrote the messagepack encoder/decoder the other I just based my work on an existing messagepack library):
Data arrive on a tcp socket, depending on the size it can either be received as one packet or multiple, the messagepack decoder read incoming data as it arrive and when it has a full "message" in the messagepack sense it calls a user method to deal with it.
I tried two methods (both in a separate, dedicated thread):
The problem I have with this library is that it does not really have a streaming api, that's not necessarly a blocking issue but how would you handle my usecase ?