This repository was archived by the owner on Sep 5, 2019. It is now read-only.
File tree 2 files changed +2
-2
lines changed
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -585,7 +585,7 @@ Notice what happens with all of the channels once we exit the accept loop:
585
585
Currently, we only ever _add_ new peers to the map.
586
586
This is clearly wrong: if a peer closes connection to the chat, we should not try to send any more messages to it.
587
587
588
- One subtlety with handing disconnection is that we can detect it either in the reader's task, or in the writer's task.
588
+ One subtlety with handling disconnection is that we can detect it either in the reader's task, or in the writer's task.
589
589
The most obvious solution here is to just remove the peer from the `peers` map in both cases, but this would be wrong.
590
590
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!
591
591
To fix this, we will only remove the peer when the write side finishes.
Original file line number Diff line number Diff line change @@ -1229,7 +1229,7 @@ <h2 id="_handling_disconnections">Handling Disconnections</h2>
1229
1229
This is clearly wrong: if a peer closes connection to the chat, we should not try to send any more messages to it.</ p >
1230
1230
</ div >
1231
1231
< div class ="paragraph ">
1232
- < p > One subtlety with handing disconnection is that we can detect it either in the reader’s task, or in the writer’s task.
1232
+ < p > One subtlety with handling disconnection is that we can detect it either in the reader’s task, or in the writer’s task.
1233
1233
The most obvious solution here is to just remove the peer from the < code > peers</ code > map in both cases, but this would be wrong.
1234
1234
If < em > both</ em > read and write fail, we’ll remove the peer twice, but it can be the case that the peer reconnected between the two failures!
1235
1235
To fix this, we will only remove the peer when the write side finishes.
You can’t perform that action at this time.
0 commit comments