@@ -18,14 +18,16 @@ internal partial class TransportConnection : IFeatureCollection,
18
18
IConnectionTransportFeature ,
19
19
IConnectionItemsFeature ,
20
20
IMemoryPoolFeature ,
21
- IConnectionLifetimeFeature
21
+ IConnectionLifetimeFeature ,
22
+ IConnectionEndPointFeature
22
23
{
23
24
// Implemented features
24
25
internal protected IConnectionIdFeature ? _currentIConnectionIdFeature ;
25
26
internal protected IConnectionTransportFeature ? _currentIConnectionTransportFeature ;
26
27
internal protected IConnectionItemsFeature ? _currentIConnectionItemsFeature ;
27
28
internal protected IMemoryPoolFeature ? _currentIMemoryPoolFeature ;
28
29
internal protected IConnectionLifetimeFeature ? _currentIConnectionLifetimeFeature ;
30
+ internal protected IConnectionEndPointFeature ? _currentIConnectionEndPointFeature ;
29
31
30
32
// Other reserved feature slots
31
33
internal protected IPersistentStateFeature ? _currentIPersistentStateFeature ;
@@ -48,6 +50,7 @@ private void FastReset()
48
50
_currentIConnectionItemsFeature = this ;
49
51
_currentIMemoryPoolFeature = this ;
50
52
_currentIConnectionLifetimeFeature = this ;
53
+ _currentIConnectionEndPointFeature = this ;
51
54
52
55
_currentIPersistentStateFeature = null ;
53
56
_currentIConnectionSocketFeature = null ;
@@ -180,6 +183,10 @@ private void ExtraFeatureSet(Type key, object? value)
180
183
{
181
184
feature = _currentIConnectionMetricsTagsFeature ;
182
185
}
186
+ else if ( key == typeof ( IConnectionEndPointFeature ) )
187
+ {
188
+ feature = _currentIConnectionEndPointFeature ;
189
+ }
183
190
else if ( MaybeExtra != null )
184
191
{
185
192
feature = ExtraFeatureGet ( key ) ;
@@ -244,6 +251,10 @@ private void ExtraFeatureSet(Type key, object? value)
244
251
{
245
252
_currentIConnectionMetricsTagsFeature = ( IConnectionMetricsTagsFeature ? ) value ;
246
253
}
254
+ else if ( key == typeof ( IConnectionEndPointFeature ) )
255
+ {
256
+ _currentIConnectionEndPointFeature = ( IConnectionEndPointFeature ? ) value ;
257
+ }
247
258
else
248
259
{
249
260
ExtraFeatureSet ( key , value ) ;
@@ -310,6 +321,10 @@ private void ExtraFeatureSet(Type key, object? value)
310
321
{
311
322
feature = Unsafe . As < IConnectionMetricsTagsFeature ? , TFeature ? > ( ref _currentIConnectionMetricsTagsFeature ) ;
312
323
}
324
+ else if ( typeof ( TFeature ) == typeof ( IConnectionEndPointFeature ) )
325
+ {
326
+ feature = Unsafe . As < IConnectionEndPointFeature ? , TFeature ? > ( ref _currentIConnectionEndPointFeature ) ;
327
+ }
313
328
else if ( MaybeExtra != null )
314
329
{
315
330
feature = ( TFeature ? ) ( ExtraFeatureGet ( typeof ( TFeature ) ) ) ;
@@ -382,6 +397,10 @@ private void ExtraFeatureSet(Type key, object? value)
382
397
{
383
398
_currentIConnectionMetricsTagsFeature = Unsafe . As < TFeature ? , IConnectionMetricsTagsFeature ? > ( ref feature ) ;
384
399
}
400
+ else if ( typeof ( TFeature ) == typeof ( IConnectionEndPointFeature ) )
401
+ {
402
+ _currentIConnectionEndPointFeature = Unsafe . As < TFeature ? , IConnectionEndPointFeature ? > ( ref feature ) ;
403
+ }
385
404
else
386
405
{
387
406
ExtraFeatureSet ( typeof ( TFeature ) , feature ) ;
@@ -442,6 +461,10 @@ private IEnumerable<KeyValuePair<Type, object>> FastEnumerable()
442
461
{
443
462
yield return new KeyValuePair < Type , object > ( typeof ( IConnectionMetricsTagsFeature ) , _currentIConnectionMetricsTagsFeature ) ;
444
463
}
464
+ if ( _currentIConnectionEndPointFeature != null )
465
+ {
466
+ yield return new KeyValuePair < Type , object > ( typeof ( IConnectionEndPointFeature ) , _currentIConnectionEndPointFeature ) ;
467
+ }
445
468
446
469
if ( MaybeExtra != null )
447
470
{
0 commit comments