refactor done for native

This commit is contained in:
John Smith
2021-12-24 18:02:53 -05:00
parent 922470365a
commit 23abaa3c99
14 changed files with 266 additions and 350 deletions

View File

@@ -185,8 +185,7 @@ impl Network {
let routing_table = network_manager.routing_table();
// Drop all dial info
routing_table.clear_local_dial_info();
routing_table.clear_global_dial_info();
routing_table.clear_dial_info_details();
// Cancels all async background tasks by dropping join handles
*self.inner.lock() = Self::new_inner(network_manager);

View File

@@ -27,12 +27,6 @@ pub enum NetworkConnection {
}
impl NetworkConnection {
pub fn protocol_type(&self) -> ProtocolType {
match self {
Self::Dummy(d) => d.protocol_type(),
Self::WS(w) => w.protocol_type(),
}
}
pub fn send(&self, message: Vec<u8>) -> SystemPinBoxFuture<Result<(), String>> {
match self {
Self::Dummy(d) => d.send(message),

View File

@@ -45,13 +45,6 @@ impl WebsocketNetworkConnection {
}
impl WebsocketNetworkConnection {
pub fn protocol_type(&self) -> ProtocolType {
if self.tls {
ProtocolType::WSS
} else {
ProtocolType::WS
}
}
pub fn send(&self, message: Vec<u8>) -> SystemPinBoxFuture<Result<(), String>> {
let inner = self.inner.clone();
Box::pin(async move {