[rabbitmq-discuss] ConnectionFactory.CreateConnection() exception when using IPv4 address
Michael Klishin
mklishin at gopivotal.com
Tue Apr 29 09:06:47 BST 2014
On 29 April 2014 at 11:29:34, ewulf84 at gmail.com (ewulf84 at gmail.com) wrote:
> > The problem appears to be in the way the SocketFrameHandler_0_9.ctor()
> determines the socket address family:
>
> if (Socket.OSSupportsIPv6)
> {
> try
> {
> this.m_socket = socketFactory(AddressFamily.InterNetworkV6);
> this.Connect(this.m_socket, endpoint, timeout);
> }
> catch (ConnectFailureException)
> {
> this.m_socket = null;
> }
> }
>
>
>
> This may not be the best way to determine whether to use an IPv6
> socket or an IPv4 socket. The ArgumentException which is getting
> thrown from down in the Socket's DoDnsCallback is not caught
> in the FrameHandler ctor and instead makes its way up to the caller.
> You may want to consider IPAddress.TryParsing the host from
> the Amqp endpoint and then getting the address family from that.
> It would probably be faster than this method, too.
>
> As it stands I cannot figure out a workaround for this issue. If
> the only way you can access a machine from an IPv6-enabled Windows
> box is via its IPv4 address you would appear to be out of luck. In
> the .Net client, anyway.
Thanks for reporting!
--
MK
Software Engineer, Pivotal/RabbitMQ
More information about the rabbitmq-discuss
mailing list