connections work
This commit is contained in:
parent
6c2aaa16c6
commit
167374969d
@ -276,7 +276,11 @@ impl NetworkManager {
|
|||||||
connection_descriptor,
|
connection_descriptor,
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
Some(d) => d,
|
Some(d) => {
|
||||||
|
// Connection couldn't send, kill it
|
||||||
|
node_ref.clear_last_connection(connection_descriptor);
|
||||||
|
d
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
data
|
data
|
||||||
|
@ -411,6 +411,13 @@ impl BucketEntryInner {
|
|||||||
.insert(key, (last_connection, timestamp));
|
.insert(key, (last_connection, timestamp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Removes a connection descriptor in this entry's table of last connections
|
||||||
|
pub fn clear_last_connection(&mut self, last_connection: ConnectionDescriptor) {
|
||||||
|
let key = self.descriptor_to_key(last_connection);
|
||||||
|
self.last_connections
|
||||||
|
.remove(&key);
|
||||||
|
}
|
||||||
|
|
||||||
// Clears the table of last connections to ensure we create new ones and drop any existing ones
|
// Clears the table of last connections to ensure we create new ones and drop any existing ones
|
||||||
pub fn clear_last_connections(&mut self) {
|
pub fn clear_last_connections(&mut self) {
|
||||||
self.last_connections.clear();
|
self.last_connections.clear();
|
||||||
|
@ -308,6 +308,12 @@ pub trait NodeRefBase: Sized {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn clear_last_connection(&self, connection_descriptor: ConnectionDescriptor) {
|
||||||
|
self.operate_mut(|rti, e| {
|
||||||
|
e.clear_last_connection(connection_descriptor);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
fn has_any_dial_info(&self) -> bool {
|
fn has_any_dial_info(&self) -> bool {
|
||||||
self.operate(|_rti, e| {
|
self.operate(|_rti, e| {
|
||||||
for rtd in RoutingDomain::all() {
|
for rtd in RoutingDomain::all() {
|
||||||
|
Loading…
Reference in New Issue
Block a user