Skip to content

Commit 07f19a5

Browse files
committed
ignore more exceptions in KestrelPipeConnection
1 parent c810d30 commit 07f19a5

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/SuperSocket.Kestrel/KestrelPipeConnection.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
namespace SuperSocket.Kestrel;
22

33
using System;
4+
using System.IO;
45
using System.IO.Pipelines;
6+
using System.Net.Sockets;
57
using System.Threading;
68
using System.Threading.Tasks;
79
using Microsoft.AspNetCore.Connections;
@@ -73,6 +75,21 @@ public override async ValueTask SendAsync<TPackage>(IPackageEncoder<TPackage> pa
7375
UpdateLastActiveTime();
7476
}
7577

78+
protected override bool IsIgnorableException(Exception e)
79+
{
80+
if (e is IOException ioe && ioe.InnerException != null)
81+
{
82+
return IsIgnorableException(ioe.InnerException);
83+
}
84+
85+
if (e is SocketException se)
86+
{
87+
return se.IsIgnorableSocketException();
88+
}
89+
90+
return base.IsIgnorableException(e);
91+
}
92+
7693
private void OnConnectionClosed()
7794
{
7895
Cancel();

0 commit comments

Comments
 (0)