Skip to content
This repository was archived by the owner on Mar 19, 2019. It is now read-only.

Commit 5061848

Browse files
committed
Add IHttpConnectionFeature.ConnectionId.
1 parent 8007020 commit 5061848

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/Microsoft.AspNetCore.Server.WebListener/FeatureContext.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// permissions and limitations under the License.
1717

1818
using System;
19+
using System.Globalization;
1920
using System.IO;
2021
using System.Net;
2122
using System.Net.WebSockets;
@@ -65,6 +66,7 @@ internal class FeatureContext :
6566
private IPAddress _localIpAddress;
6667
private int? _remotePort;
6768
private int? _localPort;
69+
private string _connectionId;
6870
private string _requestId;
6971
private X509Certificate2 _clientCert;
7072
private ClaimsPrincipal _user;
@@ -270,6 +272,19 @@ int IHttpConnectionFeature.RemotePort
270272
set { _remotePort = value; }
271273
}
272274

275+
string IHttpConnectionFeature.ConnectionId
276+
{
277+
get
278+
{
279+
if (_connectionId == null)
280+
{
281+
_connectionId = Request.ConnectionId.ToString(CultureInfo.InvariantCulture);
282+
}
283+
return _connectionId;
284+
}
285+
set { _connectionId = value; }
286+
}
287+
273288
X509Certificate2 ITlsConnectionFeature.ClientCertificate
274289
{
275290
get

src/Microsoft.Net.Http.Server/RequestProcessing/Request.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ internal SslStatus SslStatus
160160
}
161161
}
162162

163-
internal ulong ConnectionId
163+
public ulong ConnectionId
164164
{
165165
get
166166
{

0 commit comments

Comments
 (0)