@@ -129,11 +129,18 @@ public final class Server: @unchecked Sendable {
129
129
}
130
130
131
131
if #available( macOS 10 . 14 , iOS 12 . 0 , watchOS 6 . 0 , tvOS 12 . 0 , * ) ,
132
- let configurator = configuration. nwParametersConfigurator ,
132
+ let configurator = configuration. listenerNWParametersConfigurator ,
133
133
let transportServicesBootstrap = bootstrap as? NIOTSListenerBootstrap
134
134
{
135
135
_ = transportServicesBootstrap. configureNWParameters ( configurator)
136
136
}
137
+
138
+ if #available( macOS 10 . 14 , iOS 12 . 0 , watchOS 6 . 0 , tvOS 12 . 0 , * ) ,
139
+ let configurator = configuration. childChannelNWParametersConfigurator,
140
+ let transportServicesBootstrap = bootstrap as? NIOTSListenerBootstrap
141
+ {
142
+ _ = transportServicesBootstrap. configureChildNWParameters ( configurator)
143
+ }
137
144
#endif // canImport(Network)
138
145
139
146
return
@@ -392,18 +399,31 @@ extension Server {
392
399
internal var serviceProvidersByName : [ Substring : CallHandlerProvider ]
393
400
394
401
#if canImport(Network)
395
- /// A closure allowing to customise the `NWParameters` used when establising a connection using NIOTransportServices.
402
+ /// A closure allowing to customise the listener's `NWParameters` used when establishing a connection using `NIOTransportServices`.
403
+ @available ( macOS 10 . 14 , iOS 12 . 0 , watchOS 6 . 0 , tvOS 12 . 0 , * )
404
+ public var listenerNWParametersConfigurator : ( @Sendable ( NWParameters ) -> Void ) ? {
405
+ get {
406
+ self . _listenerNWParametersConfigurator as! ( @Sendable ( NWParameters ) -> Void ) ?
407
+ }
408
+ set {
409
+ self . _listenerNWParametersConfigurator = newValue
410
+ }
411
+ }
412
+
413
+ private var _listenerNWParametersConfigurator : ( any Sendable ) ?
414
+
415
+ /// A closure allowing to customise the child channels' `NWParameters` used when establishing connections using `NIOTransportServices`.
396
416
@available ( macOS 10 . 14 , iOS 12 . 0 , watchOS 6 . 0 , tvOS 12 . 0 , * )
397
- public var nwParametersConfigurator : ( @Sendable ( NWParameters ) -> Void ) ? {
417
+ public var childChannelNWParametersConfigurator : ( @Sendable ( NWParameters ) -> Void ) ? {
398
418
get {
399
- self . _nwParametersConfigurator as! ( @Sendable ( NWParameters ) -> Void ) ?
419
+ self . _childChannelNWParametersConfigurator as! ( @Sendable ( NWParameters ) -> Void ) ?
400
420
}
401
421
set {
402
- self . _nwParametersConfigurator = newValue
422
+ self . _childChannelNWParametersConfigurator = newValue
403
423
}
404
424
}
405
425
406
- private var _nwParametersConfigurator : ( any Sendable ) ?
426
+ private var _childChannelNWParametersConfigurator : ( any Sendable ) ?
407
427
#endif
408
428
409
429
/// CORS configuration for gRPC-Web support.
0 commit comments