feat: added a new connectivity reader to the Network module. It sends a low-level (ICMP) ping message to 1.1.1.1. (#1082)

This commit is contained in:
Serhiy Mytrovtsiy
2022-09-17 19:33:18 +02:00
parent dfa1553bf4
commit 4f190e9168
2 changed files with 260 additions and 0 deletions

View File

@@ -549,3 +549,12 @@ extension NSTextView {
return super.performKeyEquivalent(with: event)
}
}
public extension Data {
var socketAddress: sockaddr {
return withUnsafeBytes { $0.load(as: sockaddr.self) }
}
var socketAddressInternet: sockaddr_in {
return withUnsafeBytes { $0.load(as: sockaddr_in.self) }
}
}