Archived
3
0
This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues or pull requests.
libipc-old/README.markdown

57 lines
2.0 KiB
Markdown
Raw Normal View History

2016-05-26 18:27:59 +02:00
# connection init (draft)
2016-09-13 21:56:39 +02:00
## how things happen
2016-05-26 18:27:59 +02:00
2016-09-13 21:56:39 +02:00
* Service : daemon providing a feature (windowing, audio, …)
* Application : specific application (browser, instant messaging, …)
2016-05-26 18:47:28 +02:00
* [service] : service name
2016-09-13 21:56:39 +02:00
* $pid : application PID
* $index : process index (application point of view)
2016-05-26 18:47:28 +02:00
2016-09-13 21:56:39 +02:00
1. Service creates a pipe named /tmp/[service]
2. Application creates pipes named /tmp/$pid-$index-$version-{in,out}
3. Application sends in /tmp/[service] : $pid $index $version
2016-05-26 18:27:59 +02:00
## pure "networking" view (what should go in the pipes)
2016-09-13 21:56:39 +02:00
1. Application sends in /tmp/[service] : $pid $index $version [...]
2016-05-26 18:27:59 +02:00
# messages format
2016-09-13 21:56:39 +02:00
First of all, the application will send a message to the service's pipe in **plain text** with its PID, the number of time the process already used the service (index) and the version of the communication protocol we want to use between the application and the service.
In order to communicate between the application and the service, we use the [CBOR format (RFC 7049)][cbor].
This will be used with some conventions.
2016-05-26 18:27:59 +02:00
2016-09-15 23:08:08 +02:00
## CBOR install, programming, debug
[libcbor][libcbor] is used in the provided implementations.
It is an [extensively documented][libcbor-doc] library, easy to install and to work with.
We also strongly encourage the use of the [cbor-diag][cbor-diag] to ensure that you send and receive correctly formatted messages.
2016-05-26 18:27:59 +02:00
## overview
2016-09-13 21:56:39 +02:00
The format will be "type : value".
2016-05-26 18:27:59 +02:00
2016-09-13 21:56:39 +02:00
The type will be a simple byte :
2016-05-26 18:27:59 +02:00
2016-05-26 18:47:28 +02:00
* <0 - 15> : control, meta data
* <16 - 127> : later use
* <128 - 255> : application specific (windowing system, audio system, …)
2016-05-26 18:27:59 +02:00
2016-09-13 21:56:39 +02:00
## CBOR type convention
0 - 15
index | abbreviation | semantic
0 | close | to close the communication between the application and the service
2016-09-15 23:08:08 +02:00
1 | message | to send data
2 | error | to send an error message
2016-05-26 18:27:59 +02:00
2016-09-13 21:56:39 +02:00
[cbor]: https://tools.ietf.org/html/rfc7049
2016-09-15 23:08:08 +02:00
[cbor-diag]: https://github.com/cabo/cbor-diag
[libcbor]: https://github.com/PJK/libcbor
[libcbor-doc]: https://github.com/PJK/libcbor