Skip to content

Commit

Permalink
Update user documentation and fix typos (#5)
Browse files Browse the repository at this point in the history
* Fix user documentation

	To start diode-receive, the user must supply either
	--to_tcp <ip:port> or --to_unix <path> argument.

* Fix typos: heartbeat

* Fix typos in user documentation and README

* Fix typos in comments

* Fix typo in log message: packates -> packets

---------

Co-authored-by: aquinaou-anssi <>
  • Loading branch information
aquinaou-anssi committed Dec 15, 2023
1 parent 0c7b73d commit 5277a4f
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $ make html
$ xdg-open _build/html/index.html
```

The *developper* documentation can be built and opened by running:
The *developer* documentation can be built and opened by running:

```
$ cargo doc --document-private-items --no-deps --lib --open
Expand Down
10 changes: 5 additions & 5 deletions doc/gstarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Building lidi is fairly easy once you have all the dependencies set-up:
$ cargo build --release
This step provides you with the two main binaries for lidi: the sender and the receiver part, in addition to other utilitary binaries, such as file sending/receiving ones.
This step provides you with the two main binaries for lidi: the sender and the receiver part, in addition to other utility binaries, such as file sending/receiving ones.

Setting up a simple case
------------------------
Expand All @@ -47,11 +47,11 @@ In a first terminal, we start by running the sender part of lidi with default pa
Some information logging should will show up, especially indicating that the diode is waiting for TCP connections on port 5000 and that the traffic will go through the diode on UDP port 6000.

Next, we run the receiving part of lidi, with default parameters too:
Next, we run the receiving part of lidi:

.. code-block::
$ cargo run --release --bin diode-receive
$ cargo run --release --bin diode-receive -- --to_tcp 127.0.0.1:7000
This time, logging will indicate that traffic will come up on UDP port 6000 and that transferred content will be served on TCP port 7000.

Expand All @@ -64,7 +64,7 @@ We run a first netcat instance waiting for connection on port 7000 with the foll

.. code-block::
$ nc -lvp 7000
$ nc -lv 127.0.0.1 7000
Finally, we should be able to connect and send raw data through the diode in a fourth terminal:

Expand All @@ -74,6 +74,6 @@ Finally, we should be able to connect and send raw data through the diode in a f
Hello Lidi!
<Ctrl-D>
The message should have been transfered with only forwarding UDP traffic, to finally show up in the first waiting netcat terminal window!
The message should have been transferred with only forwarding UDP traffic, to finally show up in the first waiting netcat terminal window!

Next steps is to review :ref:`Command line parameters` to adapt them to your use case, and eventually :ref:`Tweaking parameters` to achieve optimal transfer performances.
2 changes: 0 additions & 2 deletions doc/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ On the diode-receive side, data will be sent to TCP connected clients. To specif
--to_tcp <ip:port>
Default value is 127.0.0.1:7000.

Unix data source
""""""""""""""""

Expand Down
2 changes: 1 addition & 1 deletion src/bin/diode-send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ fn main() {
encoding_block_size: config.encoding_block_size,
repair_block_size: config.repair_block_size,
nb_encoding_threads: config.nb_encoding_threads,
hearbeat_interval: config.heartbeat,
heartbeat_interval: config.heartbeat,
to_bind: config.to_bind,
to_udp: config.to_udp,
to_mtu: config.to_udp_mtu,
Expand Down
2 changes: 1 addition & 1 deletion src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl Message {
/// Some (unchecked) constraints on arguments must be respected:
/// - if `message` is `MessageType::Heartbeat`, `MessageType::Abort` or `MessageType::End`
/// then no data should be provided,
/// - if `message` is `MessageType::Heartbear` then `client_id` should be equal to 0,
/// - if `message` is `MessageType::Heartbeat` then `client_id` should be equal to 0,
/// - if there is some `data`, its length must be greater than `message_length`.
pub(crate) fn new(
message: MessageType,
Expand Down
2 changes: 1 addition & 1 deletion src/receive/clients.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Worker that aquires multiplex access and then becomes a `crate::receive::client` worker
//! Worker that acquires multiplex access and then becomes a `crate::receive::client` worker

use crate::{receive, receive::client};
use std::{io::Write, os::fd::AsRawFd};
Expand Down
2 changes: 1 addition & 1 deletion src/receive/reblock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub(crate) fn start<F>(receiver: &receive::Receiver<F>) -> Result<(), receive::E
block_id = block_id.wrapping_add(1);
} else {
log::debug!(
"no enough packets ({qlen} packates) to decode block {block_id}"
"not enough packets ({qlen} packets) to decode block {block_id}"
);
log::warn!("lost block {block_id}");
desynchro = true;
Expand Down
2 changes: 1 addition & 1 deletion src/send/heartbeat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{protocol, send};

pub(crate) fn start<C>(sender: &send::Sender<C>) -> Result<(), send::Error> {
let alarm =
crossbeam_channel::tick(sender.config.hearbeat_interval.expect("heartbeat enabled"));
crossbeam_channel::tick(sender.config.heartbeat_interval.expect("heartbeat enabled"));

loop {
sender.to_encoding.send(protocol::Message::new(
Expand Down
4 changes: 2 additions & 2 deletions src/send/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct Config {
pub encoding_block_size: u64,
pub repair_block_size: u32,
pub nb_encoding_threads: u8,
pub hearbeat_interval: Option<time::Duration>,
pub heartbeat_interval: Option<time::Duration>,
pub to_bind: net::SocketAddr,
pub to_udp: net::SocketAddr,
pub to_mtu: u16,
Expand Down Expand Up @@ -211,7 +211,7 @@ where
.spawn_scoped(scope, || encoding::start(self))?;
}

if let Some(hb_interval) = self.config.hearbeat_interval {
if let Some(hb_interval) = self.config.heartbeat_interval {
log::info!(
"heartbeat message will be sent every {} seconds",
hb_interval.as_secs()
Expand Down
2 changes: 1 addition & 1 deletion src/sock_utils.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Bindings and wrappers for socket buffer size libc funtions
//! Bindings and wrappers for socket buffer size libc functions

use std::os::fd::AsRawFd;
use std::{io, mem, ptr};
Expand Down

0 comments on commit 5277a4f

Please sign in to comment.