SwimNetworkConditionMonitor
public class SwimNetworkConditionMonitor
A monitor for network health. This uses the Reachability framework to give a reachable / unreachable indication from the OS, and uses statistics provided by the network layer (Channel) to give a more fine-grained understanding of network health, so that we can indicate whether the connection is healthy or degraded.
-
Undocumented
Declaration
Swift
public class SwimNetworkConditionMonitor
-
Undocumented
See moreDeclaration
Swift
public class SwimNetworkConditionMonitor
-
Undocumented
See moreDeclaration
Swift
public class SwimNetworkConditionMonitor
-
Start monitoring the network to the specified host. This will start Reachability monitoring if necessary.
Note that this is reference counted per host: you should pair your
startMonitoring
andstopMonitoring
calls and the monitoring will be torn down once the last monitor for a given host is stopped.Declaration
Swift
public func startMonitoring(host: String, isWWLANAllowed: Bool = default) -> SwimSwift.SwimNetworkConditionMonitor.ServerMonitor
-
Declaration
Swift
public func getMonitor(host: String) -> SwimSwift.SwimNetworkConditionMonitor.ServerMonitor?
Return Value
The ServerMonitor for the given host, if any. This does not change the reference count on the ServerMonitor.
-
Decrement the reference count on the given ServerMonitor, and stop it monitoring if the refcount drops to 0.
Declaration
Swift
public func stopMonitoring(monitor: ServerMonitor)
-
Decrement the reference count on the ServerMonitor for the given host, if any, and stop it monitoring if the refcount drops to 0.
Declaration
Swift
public func stopMonitoring(host: String)
-
Stop monitoring everything.
Declaration
Swift
public func stopMonitoringAll()