#tcp #ipc

rust_tcp_ipc

Simple to use crate for Interprocess Communication via TCP

12 releases

✓ Uses Rust 2018 edition

0.3.1 Dec 22, 2018
0.3.0 Dec 21, 2018
0.2.9 Dec 20, 2018
0.2.5 Nov 25, 2018

#507 in Network programming

Download history 113/week @ 2019-12-08 12/week @ 2019-12-22 14/week @ 2020-01-12 33/week @ 2020-01-19 13/week @ 2020-02-09 12/week @ 2020-02-16 94/week @ 2020-02-23 1/week @ 2020-03-01 25/week @ 2020-03-08 12/week @ 2020-03-15 48/week @ 2020-03-22

122 downloads per month

MIT license

49KB
754 lines

Documentation

rust_tcp_ipc

This is a crate for Interprocess Communication via TCP.

It allows for easy, asynchronous sending and receiving messages/commands.

A flexible protocol is used, consisting of a command, a length and a payload.

In detail, it is expected that the used TCP protocol works via exchange of byte collections. A fixed header length is assumed, so - for example - the first 5 bytes of each message encode the message header. The header in turn consists of a command (like Stop, Start, Pause, Load, ...) and a length part. Command & length can be in arbitrary order (but have to be fixed for the protocol). Then the next length-many bytes which are received are the payload of the message. Further received bytes form the next message.

An example is given in the Examples.

To work on this crate was motivated by a Talk given at the Regensburg Haskell Meetup in November 2018.


lib.rs:

This is a crate for Interprocess Communication via TCP.

It allows for easy, asynchronous sending and receiving messages/commands.

A flexible protocol is used, consisting of a command, a length and a payload.

In detail, it is expected that the used TCP protocol works via exchange of byte collections. A fixed header length is assumed, so - for example - the first 5 bytes of each message encode the message header. The header in turn consists of a command (like Stop, Start, Pause, Load, ...) and a length part. Command & length can be in arbitrary order (but have to be fixed for the protocol). Then the next length-many bytes which are received are the payload of the message. Further received bytes form the next message.

An example is given in the Examples.

Dependencies

~80KB