Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions protocols/writing-a-protocol.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ Copied over 13 byte(s)
You can find all of the code in the [`echo.rs` example] in the iroh repo.


# Appendix
## Appendix

## No router no problem
### No router no problem

The router can make writing code with iroh easier, but it's not required.
If the [`Router` API][router API] is too limited or perhaps too complex for your use case, it's fairly simple to replace with your own accept loop based on only `iroh::Endpoint` APIs.
Expand Down Expand Up @@ -294,7 +294,7 @@ We could even inline the whole function call instead.
You can see a version of the echo example completely without using a router or protocol handler trait in the [`echo-no-router.rs` example].


## General Guidance
### General Guidance

The echo example is a very simple protocol.
There's many ways in which a protocol in practice is going to be more complex.
Expand Down Expand Up @@ -329,4 +329,4 @@ Have fun.
[closing connections]: https://www.iroh.computer/blog/closing-a-quic-connection
[`echo.rs` example]: https://github.com/n0-computer/iroh/blob/main/iroh/examples/echo.rs
[`echo-no-router.rs` example]: https://github.com/n0-computer/iroh/blob/main/iroh/examples/echo-no-router.rs
[iroh discord]: https://iroh.computer/discord
[iroh discord]: https://iroh.computer/discord