SocketObservingStrategy class abstract
/The base for all Observing strategies for strategy that opens a socket to a list of specified addresses.
- Inheritance
-
- Object
- InternetObservingStrategy
- SocketObservingStrategy
- Implementers
Constructors
-
SocketObservingStrategy({Duration? initialDuration, required Duration interval, Duration? timeOut, required List<
InternetAddress> internetAddresses})
Properties
- disposeOnFirstConnected → bool
-
If true, the strategy will stop observing for internet changes as soon as the device is online
no setterinherited
- disposeOnFirstDisconnected → bool
-
If true, the strategy will stop observing for internet changes as soon as the device is offline
no setterinherited
- duration → Duration?
-
The duration to listen for connection event
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
hasInternetConnection
→ Future<
bool> -
The observing strategy is to ping each of the internetAddresses supplied,
Using
stream.any
to check for the first address to connect. Once an address connects, it is assumed that there is internet access and the process stopsno setteroverride - initialDuration → Duration?
-
The initial duration to wait before observing internet access
final
-
internetAddresses
↔ List<
InternetAddress> -
A list of internet addresses (with port and timeout) to ping.
getter/setter pair
- interval → Duration
-
The interval between periodic observing.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeOut → Duration?
-
The timeout period before a check request is dropped and an address is
considered unreachable.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited