Expand description
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.
Structs§
- Shutdown
Error - The error type for a shutdown attemp.
- TcpIpc
- This is the main type of the library. Here all the logic is bundle. It can be used to easily send and receive messages via TCP, allowing for many different protcols to be used.
- TcpIpc
Config - This bundles the time-settings for the protocol A ‘None’ value means that there will no time spend waiting.
Enums§
- Busy
State Query Result - The error type for a BusyState query
- Busy
State Update Result - The error type for a BusyState update
- Connect
Errors - The error type for the connect-function.
- Parse
Header Error - The error type for parsing a header which was transferred via TCP.
- Read
Thread Errors - The error type for operations in the asynchronous read thread
- Write
Message Errors - The error type for a message writing
Traits§
- Protocol
- This trait represents the TCP-Protocol to be used.