Giter Club home page Giter Club logo

framed-msgpack's Introduction

framed-msgpack

What is framed-msgpack?

The framed-msgpack project is a Rust crate, a.k.a. library, that provides a codec for use with the tokio-rs project. MessagePack-based messages, or payloads, are sent and received with the total message length prefixed as a 32-bit unsigned integer encoded in four (4) Big-Endian bytes. The implementation is largely based on the length delimited codec provided in the tokio-io module but instead of decoding and encoding a payload from a stream and sink into a byte buffer, a payload is decoded and encoded as MessagePack messages without the prefix length bytes, respectively.

Usage

First, add this to your Cargo.toml:

[dependencies]
framed-msgpack = { git = "https://github.com/volks73/framed-msgpack.git" }

Next, add this to your crate:

extern crate framed_msgpack;

Getting Started

Clone this repository, then run the following command:

$ cargo run --example echo_server

This will run a server at localhost:12345. From another terminal, connect to the server and send framed-msgpack messages. The binary messages will be returned unchanged. A combination of the netcat, nc, application on UNIX-like systems, or ncat for Windows, and the panser application can be used to create framed-msgpack messages to send to the example echo server. For example,

$ echo '[0,1,2]' | panser --from json --to json --sized-output | nc localhost 12345 | panser --from msgpack --to json --sized-input --delimited-output 0Ah
[0,1,2]
$

License

See the LICENSE file for more information about licensing and copyright.

framed-msgpack's People

Contributors

volks73 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.