Skip to content

Commit 793e66d

Browse files
authored
Add missing using directive
1 parent d7a6144 commit 793e66d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/JsonRpc/InputHandler.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.IO;
55
using System.IO.Pipelines;
66
using System.Linq;
7+
using System.Net.Sockets;
78
using System.Reactive;
89
using System.Reactive.Concurrency;
910
using System.Reactive.Disposables;
@@ -145,16 +146,13 @@ public void Start()
145146
await ProcessInputStream(_stopProcessing.Token).ConfigureAwait(false);
146147
}
147148
catch (IOException e)
149+
when (e.InnerException is SocketException { SocketErrorCode: SocketError.ConnectionReset })
148150
{
149-
if (e.InnerException is SocketException se && se.SocketErrorCode == SocketError.ConnectionReset)
150-
_logger.LogInformation(e, "Connection reset by client.");
151-
else
152-
throw;
153-
151+
_logger.LogInformation(e, "Connection reset by client.");
154152
}
155153
catch (Exception e)
156154
{
157-
_logger.LogCritical(e, "Unhandled exception");
155+
_logger.LogCritical(e, "Unhandled exception.");
158156
}
159157
}
160158
).Subscribe(_inputActive)

0 commit comments

Comments
 (0)