Skip to content

Commit f40747c

Browse files
authored
Catch unhandled exception when closing connection. (#5342)
1 parent 0ded969 commit f40747c

File tree

1 file changed

+6
-2
lines changed
  • src/System.ServiceModel.NetFramingBase/src/System/ServiceModel/Channels

1 file changed

+6
-2
lines changed

src/System.ServiceModel.NetFramingBase/src/System/ServiceModel/Channels/ConnectionPool.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,13 @@ protected override void AbortItem(IConnection item)
632632
item.Abort();
633633
}
634634

635-
protected override ValueTask CloseItemAsync(IConnection item, TimeSpan timeout)
635+
protected override async ValueTask CloseItemAsync(IConnection item, TimeSpan timeout)
636636
{
637-
return item.CloseAsync(timeout);
637+
try
638+
{
639+
await item.CloseAsync(timeout);
640+
}
641+
catch (Exception) { }
638642
}
639643

640644
public virtual bool IsCompatible(IConnectionOrientedTransportChannelFactorySettings settings)

0 commit comments

Comments
 (0)