Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Add IHttpConnectionFeature.ConnectionId. #638

Merged
merged 1 commit into from
Feb 18, 2016
Merged

Conversation

Tratcher
Copy link
Member

Depends on aspnet/HttpAbstractions#564
@halter73

Most of the noise is that I changed the existing connectionId from long to string. I also cleaned up FrameFactory.

@Tratcher Tratcher self-assigned this Feb 17, 2016
@Tratcher Tratcher added this to the 1.0.0-rc2 milestone Feb 17, 2016
@@ -194,18 +192,18 @@ private void OnRead(UvStreamHandle handle, int status)

private Frame CreateFrame()
{
return FrameFactory(this, _remoteEndPoint, _localEndPoint, _filterContext?.PrepareRequest);
return FrameFactory(this);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Tratcher Tratcher force-pushed the tratcher/connectionid branch from 1ea16f9 to a97f6b3 Compare February 17, 2016 23:40
@Tratcher
Copy link
Member Author

Updated

@halter73
Copy link
Member

:shipit:

public Connection(ListenerContext context, UvStreamHandle socket) : base(context)
{
_socket = socket;
ConnectionControl = this;

_connectionId = Interlocked.Increment(ref _lastConnectionId);
ConnectionId = Interlocked.Increment(ref _lastConnectionId).ToString(CultureInfo.InvariantCulture);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not performant enough. Take a look at what we did with request id and copy it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is a property could it be lazy-init? Though might not work with the logging; as will currently always init.

Logging could be passed a ConnectionContext rather than ConnectionId and if enabled at that level then call ConnectionId which inits the value.

Task.Id in coreclr uses this approach dotnet/coreclr#3139

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep in mind that this is once per connection, not per request. I think Frame's copy constructor would always resolve it anyways.

@Tratcher Tratcher force-pushed the tratcher/connectionid branch from a97f6b3 to f1e1d3a Compare February 18, 2016 17:36
@Tratcher
Copy link
Member Author

Updated

@Tratcher Tratcher force-pushed the tratcher/connectionid branch from f1e1d3a to 1495745 Compare February 18, 2016 18:59
@Tratcher Tratcher force-pushed the tratcher/connectionid branch from 1495745 to aef612b Compare February 18, 2016 19:35
@Tratcher Tratcher merged commit aef612b into dev Feb 18, 2016
@Tratcher Tratcher deleted the tratcher/connectionid branch February 18, 2016 19:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants