dashel  1.3.3

github.com/aseba-community/dashel

Introduction

Dashel is a cross-platform data stream helper encapsulation library. It provides a unified access to TCP/UDP sockets, serial ports, console, and files streams. It also allows a server application to wait for any activity on any combination of these streams.

Dashel was originally designed by St├ęphane Magnenat and Sebastian Gerlach. A full list of contributors is available in the README file. Dashel is licensed under a modified BSD open-source license. Source code, compilation instructions, authors and license information are available on github. Feel free to report bugs, fork Dashel and submit pull requests.

Usage

To use Dashel, you have to instantiate a Dashel::Hub. The Hub is your connection with the data streams. It is the place where you create, destroy, and synchronize them.

The example directory in Dashel distribution provides several working examples that you can read to learn to use Dashel.

Targets naming

In Dashel, streams connect to targets. A target is a string that describes a file, a TCP/UDP address/port, or a serial port. This string consists of the type of the target, a colon, followed by a semicolon separated list of parameters. This list contains key-values pairs, with a predifined order such that keys can be omitted (but if a key is present, all subsequent entries must have an explicit key). Its general syntax is thus "protocol:[param1key=]param1value;...;[paramNkey=]paramNvalue".

The following protocols are available:

The file protocol accepts the following parameters, in this implicit order:

The tcp protocol accepts the following parameters, in this implicit order:

The tcpin protocol accepts the following parameters, in this implicit order:

The tcppoll protocol accepts the following parameters, in this implicit order:

The udp protocol accepts the following parameters, in this implicit order:

The ser protocol accepts the following parameters, in this implicit order:

Protocols stdin and stdout do not take any parameter.