add network state changes to RelayLogs
Signed-off-by: Bryan Montz <bryanmontz@me.com> Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
William Casarin
parent
40e5e4a026
commit
a63ea1e22b
@@ -43,6 +43,12 @@ class RelayPool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let self, path.status != self.last_network_status {
|
||||||
|
for relay in relays {
|
||||||
|
relay.connection.log?.add("Network state: \(path.status)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self?.last_network_status = path.status
|
self?.last_network_status = path.status
|
||||||
}
|
}
|
||||||
network_monitor.start(queue: network_monitor_queue)
|
network_monitor.start(queue: network_monitor_queue)
|
||||||
@@ -108,6 +114,8 @@ class RelayPool {
|
|||||||
}
|
}
|
||||||
let relay = Relay(descriptor: desc, connection: conn)
|
let relay = Relay(descriptor: desc, connection: conn)
|
||||||
self.relays.append(relay)
|
self.relays.append(relay)
|
||||||
|
|
||||||
|
relay.connection.log.add("Network state: \(network_monitor.currentPath.status)")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This is used to retry dead connections
|
/// This is used to retry dead connections
|
||||||
|
|||||||
Reference in New Issue
Block a user