FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Streaming api issue · Issue #106 · MessagePack-CSharp/MessagePack-CSharp · GitHub

Streaming api issue #106

Description

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 ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL