aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgilles henaux <gill.henaux@gmail.com>2023-01-15 00:09:17 +0100
committergilles henaux <gill.henaux@gmail.com>2023-01-15 00:09:17 +0100
commitb81ee06a892c9c196dff6635a36be8ec48babd08 (patch)
tree142047dd3d468c8977e244067b827c614ba2e739
parent2c63cf95031ca09009affe338afe8e2e9cc68815 (diff)
[readme] Minor fixes
-rw-r--r--README.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/README.md b/README.md
index 77e16e8..e53ad4b 100644
--- a/README.md
+++ b/README.md
@@ -201,7 +201,7 @@ There are currently 3 types of channels available when you send a message:
- `UnorderedReliable`: ensure that messages sent are delivered, in any order (exemple usage: an animation trigger)
- `Unreliable`: no guarantees on the delivery or the order of processing by the receiving end (exemple usage: an entity position sent every ticks)
-By default for the server as well as the client, Quinnet creates 1 channel instance of each type, eahc with their own ChannelId. Among those, there is a `default` channel which will be used when you don't specify the channel. At startup, this default channel is an `OrderedReliable` channel.
+By default for the server as well as the client, Quinnet creates 1 channel instance of each type, each with their own `ChannelId`. Among those, there is a `default` channel which will be used when you don't specify the channel. At startup, this default channel is an `OrderedReliable` channel.
```rust
let connection = client.connection();
@@ -213,12 +213,12 @@ connection.send_message_on(ChannelId::UnorderedReliable, message);
connection.set_default_channel(ChannelId::Unreliable);
```
-One channel instance is more than enough for `UnorderedReliable` and `Unreliable` since messages are not ordered on those, in fact even if you tried to create more, Quinnet would just reuse the existing ones. This is why you can directly use their ChannelId when sending messages as seen above.
+One channel instance is more than enough for `UnorderedReliable` and `Unreliable` since messages are not ordered on those, in fact even if you tried to create more, Quinnet would just reuse the existing ones. This is why you can directly use their `ChannelId` when sending messages, as seen above.
In some cases, you may however want to create more than one channel instance, it may be the case for `OrderedReliable` channels to avoid some [Head of line blocking](https://en.wikipedia.org/wiki/Head-of-line_blocking) issues. Channels can be opened & closed at any time.
```rust
-// If you want to create more channels:
+// If you want to create more channels
let chat_channel = client.connection().open_channel(ChannelType::OrderedReliable).unwrap();
client.connection().send_message_on(chat_channel, chat_message);
```