Skip to content

Commit ba7e1d4

Browse files
Let ConnectFailureException fly free
We don't want to suppress them entirely. Methods that try IPv6 then IPv4 (or vice versa) can handle them as needed.
1 parent ff05395 commit ba7e1d4

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

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

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -284,23 +284,9 @@ private ITcpClient ConnectUsingAddressFamily(AmqpTcpEndpoint endpoint,
284284
Func<AddressFamily, ITcpClient> socketFactory,
285285
int timeout, AddressFamily family)
286286
{
287-
ITcpClient socket;
288-
try
289-
{
290-
socket = socketFactory(family);
291-
ConnectOrFail(socket, endpoint, timeout);
292-
return socket;
293-
}
294-
catch (ConnectFailureException) // could not connect using IPv6
295-
{
296-
return null;
297-
}
298-
// Mono might raise a SocketException when using IPv4 addresses on
299-
// an OS that supports IPv6
300-
catch (SocketException)
301-
{
302-
return null;
303-
}
287+
var socket = socketFactory(family);
288+
ConnectOrFail(socket, endpoint, timeout);
289+
return socket;
304290
}
305291

306292
private void ConnectOrFail(ITcpClient socket, AmqpTcpEndpoint endpoint, int timeout)

0 commit comments

Comments
 (0)