@@ -22,6 +22,10 @@ import NIOTransportServices
22
22
import NIOSSL
23
23
#endif
24
24
25
+ #if canImport(Network)
26
+ import Network
27
+ #endif
28
+
25
29
@usableFromInline
26
30
internal protocol ConnectionManagerChannelProvider {
27
31
/// Make an `EventLoopFuture<Channel>`.
@@ -75,13 +79,9 @@ internal struct DefaultChannelProvider: ConnectionManagerChannelProvider {
75
79
#if canImport(Network)
76
80
@available ( macOS 10 . 14 , iOS 12 . 0 , watchOS 6 . 0 , tvOS 12 . 0 , * )
77
81
@usableFromInline
78
- internal var nwParametersConfigurator : (
79
- @Sendable ( NIOTSConnectionBootstrap ) -> Void
80
- ) ? {
82
+ internal var nwParametersConfigurator : ( @Sendable ( NWParameters ) -> Void ) ? {
81
83
get {
82
- return self . _nwParametersConfigurator as! (
83
- @Sendable ( NIOTSConnectionBootstrap ) -> Void
84
- ) ?
84
+ self . _nwParametersConfigurator as! ( @Sendable ( NWParameters ) -> Void ) ?
85
85
}
86
86
set {
87
87
self . _nwParametersConfigurator = newValue
@@ -104,7 +104,7 @@ internal struct DefaultChannelProvider: ConnectionManagerChannelProvider {
104
104
httpMaxFrameSize: Int ,
105
105
errorDelegate: ClientErrorDelegate ? ,
106
106
debugChannelInitializer: ( ( Channel ) -> EventLoopFuture < Void > ) ? ,
107
- nwParametersConfigurator: ( @Sendable ( NIOTSConnectionBootstrap ) -> Void ) ?
107
+ nwParametersConfigurator: ( @Sendable ( NWParameters ) -> Void ) ?
108
108
) {
109
109
self . init (
110
110
connectionTarget: connectionTarget,
@@ -269,8 +269,8 @@ internal struct DefaultChannelProvider: ConnectionManagerChannelProvider {
269
269
#if canImport(Network)
270
270
if #available( macOS 10 . 14 , iOS 12 . 0 , watchOS 6 . 0 , tvOS 12 . 0 , * ) ,
271
271
let configurator = self . nwParametersConfigurator,
272
- let niotsBootstrap = bootstrap as? NIOTSConnectionBootstrap {
273
- configurator ( niotsBootstrap )
272
+ let transportServicesBootstrap = bootstrap as? NIOTSConnectionBootstrap {
273
+ _ = transportServicesBootstrap . configureNWParameters ( configurator )
274
274
}
275
275
#endif
276
276
0 commit comments