Skip to content

Commit cd82370

Browse files
authored
Merge pull request #50 from nojaf/inner-socket-exception
Capture inner SocketException from IOException.
2 parents e35b060 + b534aab commit cd82370

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Serilog.Sinks.Network/Sinks/TCP/TCPSocketWriter.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,13 @@ public static async Task<Stream> ConnectAsync(Func<Uri, Task<Stream>> connect, U
300300
catch (SocketException)
301301
{
302302
}
303+
catch (IOException e)
304+
{
305+
if (e.InnerException is not SocketException)
306+
{
307+
throw;
308+
}
309+
}
303310

304311
// If this is cancelled via the cancellationToken instead of
305312
// completing its delay, the next while-loop test will fail,

0 commit comments

Comments
 (0)