File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ extension HTTPPingClient {
180180 public let resolvedAddress : SocketAddress
181181
182182 /// The outgoing device associated with the given interface name
183- public var device : NIONetworkDevice ?
183+ public private ( set ) var device : NIONetworkDevice ?
184184
185185 /// Initialize a HTTP Ping Client `Configuration`.
186186 ///
Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ final class NIOHTTPClient: Pingable {
214214 default :
215215 ( )
216216 }
217- #elseif canImport(Glibc)
217+ #elseif canImport(Glibc) || canImport(Musl)
218218 return ( channel as! SocketOptionProvider ) . setBindToDevice ( device. name)
219219 #endif
220220 }
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ public final class ICMPPingClient: Pingable {
190190 default :
191191 ( )
192192 }
193- #elseif canImport(Glibc)
193+ #elseif canImport(Glibc) || canImport(Musl)
194194 return ( channel as! SocketOptionProvider ) . setBindToDevice ( device. name)
195195 #endif
196196 }
@@ -235,7 +235,7 @@ extension ICMPPingClient {
235235 public let resolvedAddress : SocketAddress
236236
237237 /// The outgoing device associated with the given interface name
238- public var device : NIONetworkDevice ?
238+ public private ( set ) var device : NIONetworkDevice ?
239239
240240 public init ( endpoint: EndpointTarget ,
241241 count: Int = 10 ,
Original file line number Diff line number Diff line change 1212
1313import Foundation
1414import NIOCore
15+ #if canImport(Darwin)
16+ import Darwin
17+ #elseif canImport(Glibc)
18+ import Glibc
19+ #elseif canImport(Musl)
20+ import Musl
21+ #endif
1522
1623extension NIOBSDSocket . Option {
1724 #if canImport(Darwin)
1825 public static let ip_bound_if : NIOBSDSocket . Option = Self ( rawValue: IP_BOUND_IF)
1926 public static let ipv6_bound_if : NIOBSDSocket . Option = Self ( rawValue: IPV6_BOUND_IF)
20- #elseif canImport(Glibc)
27+ #elseif canImport(Glibc) || canImport(Musl)
2128 public static let so_bindtodevice = Self ( rawValue: SO_BINDTODEVICE)
2229 #endif
2330}
2431
2532extension SocketOptionProvider {
26- #if canImport(Glibc)
33+ #if canImport(Glibc) || canImport(Musl)
34+
2735 /// Sets the socket option SO_BINDTODEVICE to `value`.
2836 ///
2937 /// - parameters:
You can’t perform that action at this time.
0 commit comments