Skip to content

Stream of bytes/frames to Messages #34

@LeeCampbell

Description

@LeeCampbell

This question in SO (http://stackoverflow.com/questions/37687605/rx-net-message-parser) asks a very valid question of how do I parse some stream of bytes into messages based on a set of rules. The rules however require knowledge of where you are in parsing logic

  • are you in the header, the body or in between messages?
  • was the previous byte and escape/control character?
  • if you are in the body, was the previous byte that is a control character itself escaped?

Thus basic Rx operators are not enough. You can get so far with Buffer(2,1) but it fails in some edge cases.

It would be good to really clean up the example into a recipe. Perhaps using Stateless as the state machine?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions