none
UdpClient Connect - An address incompatible with the requested protocol was used for Ipv6 RRS feed

  • Question

  • In System.Net.Sockets.UDPClient

    I am trying to connect to particular IPv6 address like as follows:

    UdpClient ipv6router = new UdpClient(61001);

    IPEndPoint ipend = new IPEndPoint(IPAddress.Parse("2001::abcd"), 20004);

    ipv6router.Connect(ipend);

    But it throws an exception “An address incompatible with the requested protocol was used

    The same functionality is working fine with IPv4. Whereas in IPv6 is not working as expected.

    Please help to resolve the issue.

    Friday, October 18, 2013 11:44 AM

Answers

  • Hi,

    I suspect the problem is that you are using a bad address. The 2001::/32 address range was reserved for Teredo tunneling but yours would be an invalid Teredo address.

    Try using an actual IPv6 address and see if that works.

    HTH
    --mc

    Saturday, October 19, 2013 8:15 AM