Skip to content

Commit

Permalink
close connection on error
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeguglielmo committed Nov 23, 2023
1 parent acd1099 commit 0da2008
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dht-cache/src/domocache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,12 +416,14 @@ impl DomoCache {
}
SwarmEvent::ConnectionClosed { peer_id, connection_id, endpoint, num_established: _, cause } => {
println!("Connection closed {peer_id:?}, {connection_id:?}, {endpoint:?} -> {cause:?}");
self.swarm.close_connection(connection_id);
}
SwarmEvent::ListenerError { listener_id, error } => {
println!("Listener Error {listener_id:?} -> {error:?}");
}
SwarmEvent::OutgoingConnectionError { connection_id, peer_id, error } => {
println!("Outgoing connection error {peer_id:?}, {connection_id:?} -> {error:?}");
self.swarm.close_connection(connection_id);
}
SwarmEvent::ListenerClosed { .. } => {
println!("Listener Closed");
Expand Down

0 comments on commit 0da2008

Please sign in to comment.