connections work
This commit is contained in:
		| @@ -276,7 +276,11 @@ impl NetworkManager { | ||||
|                         connection_descriptor, | ||||
|                     ))); | ||||
|                 } | ||||
|                 Some(d) => d, | ||||
|                 Some(d) => { | ||||
|                     // Connection couldn't send, kill it | ||||
|                     node_ref.clear_last_connection(connection_descriptor); | ||||
|                     d | ||||
|                 } | ||||
|             } | ||||
|         } else { | ||||
|             data | ||||
|   | ||||
| @@ -411,6 +411,13 @@ impl BucketEntryInner { | ||||
|             .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 | ||||
|     pub fn clear_last_connections(&mut self) { | ||||
|         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 { | ||||
|         self.operate(|_rti, e| { | ||||
|             for rtd in RoutingDomain::all() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user