Skip to content

Commit a76fb58

Browse files
committed
network-comments: Updated PR based upon feedback received.
1 parent 60f93e7 commit a76fb58

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

stdlib/public/SDK/Network/NWConnection.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import _SwiftNetworkOverlayShims
2323
@available(macOS 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
2424
public final class NWConnection : CustomDebugStringConvertible {
2525

26-
/// String based debugging representation of the NWConnection type.
2726
public var debugDescription: String {
2827
return String("\(self.nw)")
2928
}
@@ -479,7 +478,7 @@ public final class NWConnection : CustomDebugStringConvertible {
479478
}
480479
}
481480

482-
/// Definition of callbacks used when sending data to the protocol stack.
481+
/// Callbacks used when sending data to the protocol stack.
483482
public enum SendCompletion {
484483
/// Completion handler to be invoked when send content has been successfully processed, or failed to send due to an error.
485484
/// Note that this does not guarantee that the data was sent out over the network, or acknowledge, but only that

stdlib/public/SDK/Network/NWEndpoint.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private func getnameinfo_numeric(address: UnsafeRawPointer) -> String {
114114
return result ?? "?"
115115
}
116116

117-
/// An IP address protocol
117+
/// An IP address
118118
@available(macOS 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
119119
public protocol IPAddress {
120120

@@ -244,7 +244,7 @@ public struct IPv4Address: IPAddress, Hashable, CustomDebugStringConvertible {
244244
/// The interface the address is scoped to, if any.
245245
public let interface: NWInterface?
246246

247-
/// Hashable
247+
// Hashable
248248
public static func == (lhs: IPv4Address, rhs: IPv4Address) -> Bool {
249249
return lhs.address.s_addr == rhs.address.s_addr && lhs.interface == rhs.interface
250250
}
@@ -254,7 +254,7 @@ public struct IPv4Address: IPAddress, Hashable, CustomDebugStringConvertible {
254254
hasher.combine(self.interface)
255255
}
256256

257-
/// CustomDebugStringConvertible returning a debug description string of the IPv4 address and interface or just the address.
257+
// CustomDebugStringConvertible
258258
public var debugDescription: String {
259259
var sin = sockaddr_in(self.address, 0)
260260
let addressString = getnameinfo_numeric(address: &sin)
@@ -434,7 +434,7 @@ public struct IPv6Address: IPAddress, Hashable, CustomDebugStringConvertible {
434434
hasher.combine(self.interface)
435435
}
436436

437-
/// CustomDebugStringConvertible returning a debug description string of the IPv6 address and interface or just the address.
437+
// CustomDebugStringConvertible
438438
public var debugDescription: String {
439439
var sin6 = sockaddr_in6(self.address, 0)
440440
let addressString = getnameinfo_numeric(address: &sin6)
@@ -524,7 +524,7 @@ public enum NWEndpoint: Hashable, CustomDebugStringConvertible {
524524
return interface
525525
}
526526
}
527-
527+
528528
public var debugDescription: String {
529529
switch self {
530530
case .ipv4(let ip4):
@@ -630,12 +630,11 @@ public enum NWEndpoint: Hashable, CustomDebugStringConvertible {
630630
if let nwinterface = nw_endpoint_copy_interface(nw) {
631631
interface = NWInterface(nwinterface)
632632
}
633-
if nw_endpoint_get_type(nw) == Network.nw_endpoint_type_host{
633+
if nw_endpoint_get_type(nw) == Network.nw_endpoint_type_host {
634634

635635
let host = NWEndpoint.Host.name(String(cString: nw_endpoint_get_hostname(nw)), interface)
636636
self = .hostPort(host: host, port: NWEndpoint.Port(nw_endpoint_get_port(nw)))
637637
} else if nw_endpoint_get_type(nw) == Network.nw_endpoint_type_address {
638-
639638
let port = NWEndpoint.Port(nw_endpoint_get_port(nw))
640639
let address = nw_endpoint_get_address(nw)
641640
if address.pointee.sa_family == AF_INET && address.pointee.sa_len == MemoryLayout<sockaddr_in>.size {

stdlib/public/SDK/Network/NWPath.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public struct NWInterface : Hashable, CustomDebugStringConvertible {
2222
return self.name
2323
}
2424

25-
/// Comparison function to determine the equality of two network interfaces by name and kernel index.
2625
public static func ==(lhs: NWInterface, rhs: NWInterface) -> Bool {
2726
return lhs.index == rhs.index && lhs.name == rhs.name
2827
}
@@ -75,7 +74,8 @@ public struct NWInterface : Hashable, CustomDebugStringConvertible {
7574
}
7675
}
7776
}
78-
// The interface type, such as other, wifi, cellular, wiredEthernet, and loopback.
77+
78+
/// The interface types wifi, cellular, wiredEthernet, and loopback.
7979
public let type: InterfaceType
8080

8181
/// The name of the interface, such as "en0"

0 commit comments

Comments
 (0)