Skip to content
This repository was archived by the owner on Sep 5, 2019. It is now read-only.

Commit b37723c

Browse files
matkladskade
andauthored
Update tutorial.adoc
Co-Authored-By: Florian Gilcher <[email protected]>
1 parent 6ec454f commit b37723c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tutorial.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ Notice what happens with all of the channels once we exit the accept loop:
583583
Currently, we only ever _add_ new peers to the map.
584584
This is clearly wrong: if a peer closes connection to the chat, we should not try to send any more messages to it.
585585

586-
One subtlety with handing disconnection is that we can detect it either in the reader's task, or in the writer's task.
586+
One subtlety with handling disconnection is that we can detect it either in the reader's task, or in the writer's task.
587587
The most obvious solution here is to just remove the peer from the `peers` map in both cases, but this would be wrong.
588588
If _both_ read and write fail, we'll remove the peer twice, but it can be the case that the peer reconnected between the two failures!
589589
To fix this, we will only remove the peer when the write side finishes.

0 commit comments

Comments
 (0)