Introduce client-side timeout when trying to connect
This commit is contained in:
parent
a19783919c
commit
cc56fa9ea6
2 changed files with 112 additions and 29 deletions
|
@ -101,10 +101,12 @@ impl FakeServer {
|
|||
}
|
||||
|
||||
pub fn disconnect(&self) {
|
||||
self.peer.disconnect(self.connection_id());
|
||||
let mut state = self.state.lock();
|
||||
state.connection_id.take();
|
||||
state.incoming.take();
|
||||
if self.state.lock().connection_id.is_some() {
|
||||
self.peer.disconnect(self.connection_id());
|
||||
let mut state = self.state.lock();
|
||||
state.connection_id.take();
|
||||
state.incoming.take();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn auth_count(&self) -> usize {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue