Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit f510759

Browse files
khellangTratcher
authored andcommitted
Add Id to ConnectionInfo (#828)
1 parent 412e4de commit f510759

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/Microsoft.AspNetCore.Http.Abstractions/ConnectionInfo.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ namespace Microsoft.AspNetCore.Http
1010
{
1111
public abstract class ConnectionInfo
1212
{
13+
/// <summary>
14+
/// Gets or sets a unique identifier to represent this connection.
15+
/// </summary>
16+
public abstract string Id { get; set; }
17+
1318
public abstract IPAddress RemoteIpAddress { get; set; }
1419

1520
public abstract int RemotePort { get; set; }
@@ -22,4 +27,4 @@ public abstract class ConnectionInfo
2227

2328
public abstract Task<X509Certificate2> GetClientCertificateAsync(CancellationToken cancellationToken = new CancellationToken());
2429
}
25-
}
30+
}

src/Microsoft.AspNetCore.Http/Internal/DefaultConnectionInfo.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ public virtual void Uninitialize()
3939
private ITlsConnectionFeature TlsConnectionFeature=>
4040
_features.Fetch(ref _features.Cache.TlsConnection, _newTlsConnectionFeature);
4141

42+
/// <inheritdoc />
43+
public override string Id
44+
{
45+
get { return HttpConnectionFeature.ConnectionId; }
46+
set { HttpConnectionFeature.ConnectionId = value; }
47+
}
48+
4249
public override IPAddress RemoteIpAddress
4350
{
4451
get { return HttpConnectionFeature.RemoteIpAddress; }
@@ -80,4 +87,4 @@ struct FeatureInterfaces
8087
public ITlsConnectionFeature TlsConnection;
8188
}
8289
}
83-
}
90+
}

0 commit comments

Comments
 (0)