@@ -18,14 +18,16 @@ internal partial class TransportConnection : IFeatureCollection,
1818 IConnectionTransportFeature ,
1919 IConnectionItemsFeature ,
2020 IMemoryPoolFeature ,
21- IConnectionLifetimeFeature
21+ IConnectionLifetimeFeature ,
22+ IConnectionEndPointFeature
2223 {
2324 // Implemented features
2425 internal protected IConnectionIdFeature ? _currentIConnectionIdFeature ;
2526 internal protected IConnectionTransportFeature ? _currentIConnectionTransportFeature ;
2627 internal protected IConnectionItemsFeature ? _currentIConnectionItemsFeature ;
2728 internal protected IMemoryPoolFeature ? _currentIMemoryPoolFeature ;
2829 internal protected IConnectionLifetimeFeature ? _currentIConnectionLifetimeFeature ;
30+ internal protected IConnectionEndPointFeature ? _currentIConnectionEndPointFeature ;
2931
3032 // Other reserved feature slots
3133 internal protected IPersistentStateFeature ? _currentIPersistentStateFeature ;
@@ -48,6 +50,7 @@ private void FastReset()
4850 _currentIConnectionItemsFeature = this ;
4951 _currentIMemoryPoolFeature = this ;
5052 _currentIConnectionLifetimeFeature = this ;
53+ _currentIConnectionEndPointFeature = this ;
5154
5255 _currentIPersistentStateFeature = null ;
5356 _currentIConnectionSocketFeature = null ;
@@ -180,6 +183,10 @@ private void ExtraFeatureSet(Type key, object? value)
180183 {
181184 feature = _currentIConnectionMetricsTagsFeature ;
182185 }
186+ else if ( key == typeof ( IConnectionEndPointFeature ) )
187+ {
188+ feature = _currentIConnectionEndPointFeature ;
189+ }
183190 else if ( MaybeExtra != null )
184191 {
185192 feature = ExtraFeatureGet ( key ) ;
@@ -244,6 +251,10 @@ private void ExtraFeatureSet(Type key, object? value)
244251 {
245252 _currentIConnectionMetricsTagsFeature = ( IConnectionMetricsTagsFeature ? ) value ;
246253 }
254+ else if ( key == typeof ( IConnectionEndPointFeature ) )
255+ {
256+ _currentIConnectionEndPointFeature = ( IConnectionEndPointFeature ? ) value ;
257+ }
247258 else
248259 {
249260 ExtraFeatureSet ( key , value ) ;
@@ -310,6 +321,10 @@ private void ExtraFeatureSet(Type key, object? value)
310321 {
311322 feature = Unsafe . As < IConnectionMetricsTagsFeature ? , TFeature ? > ( ref _currentIConnectionMetricsTagsFeature ) ;
312323 }
324+ else if ( typeof ( TFeature ) == typeof ( IConnectionEndPointFeature ) )
325+ {
326+ feature = Unsafe . As < IConnectionEndPointFeature ? , TFeature ? > ( ref _currentIConnectionEndPointFeature ) ;
327+ }
313328 else if ( MaybeExtra != null )
314329 {
315330 feature = ( TFeature ? ) ( ExtraFeatureGet ( typeof ( TFeature ) ) ) ;
@@ -382,6 +397,10 @@ private void ExtraFeatureSet(Type key, object? value)
382397 {
383398 _currentIConnectionMetricsTagsFeature = Unsafe . As < TFeature ? , IConnectionMetricsTagsFeature ? > ( ref feature ) ;
384399 }
400+ else if ( typeof ( TFeature ) == typeof ( IConnectionEndPointFeature ) )
401+ {
402+ _currentIConnectionEndPointFeature = Unsafe . As < TFeature ? , IConnectionEndPointFeature ? > ( ref feature ) ;
403+ }
385404 else
386405 {
387406 ExtraFeatureSet ( typeof ( TFeature ) , feature ) ;
@@ -442,6 +461,10 @@ private IEnumerable<KeyValuePair<Type, object>> FastEnumerable()
442461 {
443462 yield return new KeyValuePair < Type , object > ( typeof ( IConnectionMetricsTagsFeature ) , _currentIConnectionMetricsTagsFeature ) ;
444463 }
464+ if ( _currentIConnectionEndPointFeature != null )
465+ {
466+ yield return new KeyValuePair < Type , object > ( typeof ( IConnectionEndPointFeature ) , _currentIConnectionEndPointFeature ) ;
467+ }
445468
446469 if ( MaybeExtra != null )
447470 {
0 commit comments