Skip to content

Commit

Permalink
Deregister connection before dropping it in TCP example
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasdezeeuw committed Nov 7, 2021
1 parent 05009e4 commit 47cf59c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/tcp_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ fn main() -> io::Result<()> {
false
};
if done {
connections.remove(&token);
if let Some(mut connection) = connections.remove(&token) {
poll.registry().deregister(&mut connection)?;
}
}
}
}
Expand Down

0 comments on commit 47cf59c

Please sign in to comment.