Skip to content

Commit

Permalink
fixed close reason and loca/remote endpoints for KestrelPipeConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
kerryjiang committed Mar 30, 2024
1 parent 7e45414 commit 9f8ae75
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/SuperSocket.Kestrel/KestrelPipeConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public KestrelPipeConnection(ConnectionContext context, ConnectionOptions option
: base(context.Transport.Input, context.Transport.Output, options)
{
_context = context;
context.ConnectionClosed.Register(() => OnClosed());
LocalEndPoint = context.LocalEndPoint;
RemoteEndPoint = context.RemoteEndPoint;
}

protected override async void Close()
Expand All @@ -28,4 +31,12 @@ protected override async void Close()
await context.DisposeAsync();
}
}

protected override void OnClosed()
{
if (!CloseReason.HasValue)
CloseReason = Connection.CloseReason.RemoteClosing;

base.OnClosed();
}
}

0 comments on commit 9f8ae75

Please sign in to comment.