From 7ec3ad654329613377582ebfa4573039ac4f117f Mon Sep 17 00:00:00 2001 From: wujun <8400684@qq.com> Date: Mon, 9 Dec 2024 09:35:24 +0800 Subject: [PATCH] When kestrelconnection DetachAsync does not call reader.Complete() --- src/SuperSocket.Connection/PipeConnectionBase.cs | 7 ++++++- src/SuperSocket.Kestrel/KestrelPipeConnection.cs | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/SuperSocket.Connection/PipeConnectionBase.cs b/src/SuperSocket.Connection/PipeConnectionBase.cs index 7c5dd4b40..16936a86b 100644 --- a/src/SuperSocket.Connection/PipeConnectionBase.cs +++ b/src/SuperSocket.Connection/PipeConnectionBase.cs @@ -305,7 +305,7 @@ protected async Task ReadPipeAsync(PipeReader reader, IObjectPipe< } } - reader.Complete(); + OnReaderComplete(reader, _isDetaching); WriteEOFPackage(); } @@ -413,5 +413,10 @@ protected void OnError(string message, Exception e = null) else Logger?.LogError(message); } + + protected virtual void OnReaderComplete(PipeReader reader, bool isDetaching) + { + reader.Complete(); + } } } diff --git a/src/SuperSocket.Kestrel/KestrelPipeConnection.cs b/src/SuperSocket.Kestrel/KestrelPipeConnection.cs index 600c5600d..06286dff3 100644 --- a/src/SuperSocket.Kestrel/KestrelPipeConnection.cs +++ b/src/SuperSocket.Kestrel/KestrelPipeConnection.cs @@ -103,4 +103,12 @@ protected override Task StartInputPipeTask(IObjectPipe