@@ -114,7 +114,7 @@ private func getnameinfo_numeric(address: UnsafeRawPointer) -> String {
114
114
return result ?? " ? "
115
115
}
116
116
117
- /// An IP address protocol
117
+ /// An IP address
118
118
@available ( macOS 10 . 14 , iOS 12 . 0 , watchOS 5 . 0 , tvOS 12 . 0 , * )
119
119
public protocol IPAddress {
120
120
@@ -244,7 +244,7 @@ public struct IPv4Address: IPAddress, Hashable, CustomDebugStringConvertible {
244
244
/// The interface the address is scoped to, if any.
245
245
public let interface : NWInterface ?
246
246
247
- /// Hashable
247
+ // Hashable
248
248
public static func == ( lhs: IPv4Address , rhs: IPv4Address ) -> Bool {
249
249
return lhs. address. s_addr == rhs. address. s_addr && lhs. interface == rhs. interface
250
250
}
@@ -254,7 +254,7 @@ public struct IPv4Address: IPAddress, Hashable, CustomDebugStringConvertible {
254
254
hasher. combine ( self . interface)
255
255
}
256
256
257
- /// CustomDebugStringConvertible returning a debug description string of the IPv4 address and interface or just the address.
257
+ // CustomDebugStringConvertible
258
258
public var debugDescription : String {
259
259
var sin = sockaddr_in ( self . address, 0 )
260
260
let addressString = getnameinfo_numeric ( address: & sin)
@@ -434,7 +434,7 @@ public struct IPv6Address: IPAddress, Hashable, CustomDebugStringConvertible {
434
434
hasher. combine ( self . interface)
435
435
}
436
436
437
- /// CustomDebugStringConvertible returning a debug description string of the IPv6 address and interface or just the address.
437
+ // CustomDebugStringConvertible
438
438
public var debugDescription : String {
439
439
var sin6 = sockaddr_in6 ( self . address, 0 )
440
440
let addressString = getnameinfo_numeric ( address: & sin6)
@@ -524,7 +524,7 @@ public enum NWEndpoint: Hashable, CustomDebugStringConvertible {
524
524
return interface
525
525
}
526
526
}
527
-
527
+
528
528
public var debugDescription : String {
529
529
switch self {
530
530
case . ipv4( let ip4) :
@@ -630,12 +630,11 @@ public enum NWEndpoint: Hashable, CustomDebugStringConvertible {
630
630
if let nwinterface = nw_endpoint_copy_interface ( nw) {
631
631
interface = NWInterface ( nwinterface)
632
632
}
633
- if nw_endpoint_get_type ( nw) == Network . nw_endpoint_type_host{
633
+ if nw_endpoint_get_type ( nw) == Network . nw_endpoint_type_host {
634
634
635
635
let host = NWEndpoint . Host. name ( String ( cString: nw_endpoint_get_hostname ( nw) ) , interface)
636
636
self = . hostPort( host: host, port: NWEndpoint . Port ( nw_endpoint_get_port ( nw) ) )
637
637
} else if nw_endpoint_get_type ( nw) == Network . nw_endpoint_type_address {
638
-
639
638
let port = NWEndpoint . Port ( nw_endpoint_get_port ( nw) )
640
639
let address = nw_endpoint_get_address ( nw)
641
640
if address. pointee. sa_family == AF_INET && address. pointee. sa_len == MemoryLayout< sockaddr_in> . size {
0 commit comments