Skip to content

Commit e7b6a95

Browse files
Addressed PR feedback.
Generated TransportConnection file using CodeGenerator
1 parent 703511e commit e7b6a95

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/Servers/Kestrel/shared/TransportConnection.FeatureCollection.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Buffers;
55
using System.Collections.Generic;
66
using System.IO.Pipelines;
7+
using System.Net.Sockets;
78
using System.Threading;
89
using Microsoft.AspNetCore.Connections.Features;
910

@@ -15,7 +16,8 @@ internal partial class TransportConnection : IConnectionIdFeature,
1516
IConnectionTransportFeature,
1617
IConnectionItemsFeature,
1718
IMemoryPoolFeature,
18-
IConnectionLifetimeFeature
19+
IConnectionLifetimeFeature,
20+
IConnectionSocketFeature
1921
{
2022
// NOTE: When feature interfaces are added to or removed from this TransportConnection class implementation,
2123
// then the list of `features` in the generated code project MUST also be updated.
@@ -41,6 +43,8 @@ CancellationToken IConnectionLifetimeFeature.ConnectionClosed
4143
set => ConnectionClosed = value;
4244
}
4345

46+
Socket? IConnectionSocketFeature.Socket { get; }
47+
4448
void IConnectionLifetimeFeature.Abort() => Abort(new ConnectionAbortedException("The connection was aborted by the application via IConnectionLifetimeFeature.Abort()."));
4549
}
4650
}

src/Servers/Kestrel/shared/TransportConnection.Generated.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ private void FastReset()
3333
_currentIMemoryPoolFeature = this;
3434
_currentIConnectionLifetimeFeature = this;
3535
_currentIConnectionSocketFeature = this;
36+
3637
}
3738

3839
// Internal for testing

src/Servers/Kestrel/tools/CodeGenerator/TransportConnectionFeatureCollection.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public static string GenerateFile()
1515
"IConnectionTransportFeature",
1616
"IConnectionItemsFeature",
1717
"IMemoryPoolFeature",
18-
"IConnectionLifetimeFeature"
18+
"IConnectionLifetimeFeature",
19+
"IConnectionSocketFeature"
1920
};
2021

2122
var usings = $@"

0 commit comments

Comments
 (0)