forked from mirror/async-std
markup and typo nits
This commit is contained in:
parent
a41b87205d
commit
9974ff692e
2 changed files with 6 additions and 7 deletions
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
Nothing is as simple as a chat server, right? Not quite, chat servers
|
Nothing is as simple as a chat server, right? Not quite, chat servers
|
||||||
already expose you to all the fun of asynchronous programming: how
|
already expose you to all the fun of asynchronous programming: how
|
||||||
do you handle client connecting concurrently. How do handle them disconnecting?
|
do you handle clients connecting concurrently. How do you handle them disconnecting?
|
||||||
How do your distribute the messages?
|
How do you distribute the messages?
|
||||||
|
|
||||||
In this tutorial, we will show you how to write one in `async-std`.
|
In this tutorial, we will show you how to write one in `async-std`.
|
||||||
|
|
||||||
|
|
|
@ -8,15 +8,15 @@ Protocol consists of utf-8 messages, separated by `\n`.
|
||||||
The client connects to the server and sends login as a first line.
|
The client connects to the server and sends login as a first line.
|
||||||
After that, the client can send messages to other clients using the following syntax:
|
After that, the client can send messages to other clients using the following syntax:
|
||||||
|
|
||||||
```
|
```text
|
||||||
login1, login2, ... login2: message
|
login1, login2, ... loginN: message
|
||||||
```
|
```
|
||||||
|
|
||||||
Each of the specified clients than receives a `from login: message` message.
|
Each of the specified clients than receives a `from login: message` message.
|
||||||
|
|
||||||
A possible session might look like this
|
A possible session might look like this
|
||||||
|
|
||||||
```
|
```text
|
||||||
On Alice's computer: | On Bob's computer:
|
On Alice's computer: | On Bob's computer:
|
||||||
|
|
||||||
> alice | > bob
|
> alice | > bob
|
||||||
|
@ -29,7 +29,6 @@ On Alice's computer: | On Bob's computer:
|
||||||
The main challenge for the chat server is keeping track of many concurrent connections.
|
The main challenge for the chat server is keeping track of many concurrent connections.
|
||||||
The main challenge for the chat client is managing concurrent outgoing messages, incoming messages and user's typing.
|
The main challenge for the chat client is managing concurrent outgoing messages, incoming messages and user's typing.
|
||||||
|
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
Let's create a new Cargo project:
|
Let's create a new Cargo project:
|
||||||
|
@ -45,4 +44,4 @@ At the moment `async-std` requires Rust nightly, so let's add a rustup override
|
||||||
$ rustup override add nightly
|
$ rustup override add nightly
|
||||||
$ rustc --version
|
$ rustc --version
|
||||||
rustc 1.38.0-nightly (c4715198b 2019-08-05)
|
rustc 1.38.0-nightly (c4715198b 2019-08-05)
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue