Expand description
This module implements full networking stack. The stack is implemented as a set of asynchronous tasks communicating via channels.
Bellow, ---> lines represent channels and * * > represent task
cancellation tokens.
+-------------+
| |
+-----------+ | usender | * * *
| | | *
| +-------------+ *
v *
+-------------+ +-------------+ *
| | | | < * *
| dsender | <-----+ | resender |
| | | | * * * *
+-------------+ +-------------+ *
^ *
| +-------------+ *
| | | *
+-----------+ | confirmer | < * *
| | * *
+-------------+ * *
* *
+-------------+ +-------------+ * *
| | | | * *
| dreceiver | +-----> | ureceiver | * * *
| | | | *
+-------------+ +-------------+ *
+ *
| +-------------+ *
| | | *
+-----------> | sreceiver | < * * *
| |
+-------------+
dsender and dreceiver are responsible for sending and receiving UDP
datagrams. Both are terminated soon after all their channels are closed.
resender is responsible for redelivery of reliably sent datagrams whose
confirmation was not received within a time limit. If all attempts fail,
the user is informed via ConnErrorReceiver.
sreceiver is responsible for processing of system / protocol datagrams.
These include delivery confirmations.
confirmer is responsible for sending of datagram delivery confirmations.
resender, sreceiver, and confirmer are terminated soon after their
cancellation token is canceled.
usender and ureceiver are responsible for sending and reception of user
data. The user communicates with these via PackageSender and
PackageReceiver respectively.
Re-exports§
pub use communicator::ConnErrorReceiver;pub use communicator::ConnectionError;pub use communicator::InPackage;pub use communicator::MessageDecoder;pub use communicator::OutPackage;pub use communicator::PackageBuilder;pub use communicator::PackageIterator;pub use communicator::PackageReceiver;pub use communicator::PackageSender;
Modules§
Constants§
Functions§
- Setups and starts communication stack tasks and returns communication channels for data sending, data retrieval, and error retrieval.