isHostReachable method
Implementation
Future<AddressCheckResult> isHostReachable(
AddressCheckOptions options,
) async {
Socket? sock;
try {
sock = await Socket.connect(
options.address,
options.port,
timeout: options.timeout,
)
..destroy();
return AddressCheckResult(
options,
true,
);
} catch (e) {
sock?.destroy();
return AddressCheckResult(
options,
false,
);
}
}