-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getting started rewrite + intro to tokio features #394
Conversation
Would appreciate if @carllerche or someone could review this for technical accuracy -- I have a couple of folks who are new(er) to tokio and will review for clarity, but want to make sure I'm not misleading them! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nothing blocking :) Great work!
also feel free to ping me for more reviews |
fix capitalization of TcpStream Co-Authored-By: Lucio Franco <[email protected]>
Co-Authored-By: Lucio Franco <[email protected]>
This is great! I suggest we add a section at the beginning that says what audience we're writing this for (e.g. people new to Tokio but not Rust). Also I would add a section saying what version this code was tested with and mention the min. version of Rust that works with this tutorial. Also, I think it would be helpful if we preface code blocks with filenames. |
hello world starts with socat / telnet example added Network Utils section with doc for socat & telnet
I think I've addressed all the feedback. I would like someone to proof-read the text and plan to write issues for the TODOs in the PR description above. |
abstractions over networking and I/O-operations as the corresponding modules in | ||
`std` with a difference: all actions are performed asynchronously. | ||
An easy way to simulate a client (for a text-based protocol) is to use | ||
[`telnet`]. To connect to our simulated server, we'll open a different |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for not providing this feedback before, but I would suggest using netcat (nc
) instead of telnet. I think nc
is now more likely to be found on OSes (including Mac OS X) without a separate install. Also, as network code debugging tool, telnet can have some weird side effects (because it's primarily written for the telnet protocol, which is almost, but not quite, plain text; see the Wikipedia page).
Let's quit telnet and write some Rust code to send some text to our server. | ||
To *escape* from our TCP session (`^]`), we need to hold down `Ctrl` key and | ||
type `]`). Then at the telnet prompt (`telnet >`), typing `quit` will close | ||
the connection and exit the program. (Closing the Telnet/TCP connection | ||
also causes socat to quit.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With nc
exiting is just ctrl-d
so less to read. :-)
## Debian / Ubuntu Linux | ||
|
||
```bash | ||
sudo apt-get update && sudo apt-get install telnet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure nc
is included on Debian and Ubuntu by default, but haven't confirmed.
## Mac Homebrew | ||
|
||
```bash | ||
brew install telnet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nc
is included on Mac OS X (telnet
has been removed starting with High Sierra).
added consideration for |
fix(docs): line about npm run setup
simplify "hello world"
io
so removed from textnew page: intro to feature dependencies. The idea is to just walk through the few feature that are used in the "hello world" app so that people understand the concept.
features = ...
#401 for feature topic pageNetwork utilities section -- this is a bit bare bones right now. I didn't feel good about using anything in the guide without install instructions and it's a bit verbose without instructions. -- open issue for x-platform testing and maybe using
nc
instead oftelnet
test install instructions for network utils on Mac, Windows, Unix #407