Skip to content

Commit 90e632d

Browse files
Ignore SocketExceptions when shutting down
1 parent 4861ee5 commit 90e632d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

projects/client/RabbitMQ.Client/src/client/impl/ConnectionBase.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,15 @@ public void MainLoop()
665665
// connection closes.
666666
if (shutdownCleanly)
667667
{
668-
ClosingLoop();
668+
try
669+
{
670+
ClosingLoop();
671+
} catch (SocketException se)
672+
{
673+
// means that socket was closed when frame handler
674+
// attempted to use it. Since we are shutting down,
675+
// ignore it.
676+
}
669677
}
670678

671679
FinishClose();

0 commit comments

Comments
 (0)