CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Seattle, WA

    Mingling IPv4 and IPv6

    I am working with both TCP and UDP in an environment in which both IPv4 and IPv6 addresses exist. I recently got into trouble and traced the issue to the fact that I was attempting to bind to a local IPv6 address and then sendto (UDP) or connect (TCP) to a remote IPv4 address.

    It is necessary to bind to a local address explicitly because I need to be able to control which interface is used for communications.

    My question is, what is the best practice here? My current approach is to test whether the remote address is v4 or v6 and find a local address of the same type to bind to. Is that ideal? It seems like if the remote address is v6 but there are no local v6 addresses, then there should be a way to make it still work, since IPv4 can be embedded into v6, but I'm not sure of the mechanics necessary to ensure that. If the remote is v4 but there are only v6 addresses locally, there may be nothing I can do, but maybe there is if the local v6 address is v4 compatible?

    I'm actually doing this in Java but I prefer to ask in this forum since it's more domain-specific, and the particular API calls are less important than what needs to happen conceptually. I am primarily interested in link-local communication for now if that makes a difference.

  2. #2
    Join Date
    May 2001

    Re: Mingling IPv4 and IPv6

    A quick google search came up with this converter: http://ipv6.ztsoftware.net/
    I could not find a page explaining the conversion rules, but maybe this can help you as a starting point?

  3. #3
    Join Date
    Aug 2012

    Re: Mingling IPv4 and IPv6

    Go to this. It may Help you......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.