Skip to content

Commit ff05395

Browse files
Handle ConnectUsingIPv6 failures, retry with IPv4
1 parent 6f6f652 commit ff05395

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,14 @@ public SocketFrameHandler(AmqpTcpEndpoint endpoint,
8787

8888
if (Socket.OSSupportsIPv6 && endpoint.AddressFamily != AddressFamily.InterNetwork)
8989
{
90-
m_socket = ConnectUsingIPv6(endpoint, socketFactory, connectionTimeout);
90+
try {
91+
m_socket = ConnectUsingIPv6(endpoint, socketFactory, connectionTimeout);
92+
#pragma warning disable 0168
93+
} catch (ConnectFailureException cfe)
94+
#pragma warning restore 0168
95+
{
96+
m_socket = null;
97+
}
9198
}
9299

93100
if (m_socket == null && endpoint.AddressFamily != AddressFamily.InterNetworkV6)

0 commit comments

Comments
 (0)