Archived

This forum has been archived. Please start a new discussion on GitHub.

IPv6 localhost endpoints

L.S.,

Of the two lines , the upper one works, the next not. I seem not to be able to figure out what the problem is. This is in C++. Someone? (I'm not using them together)

adapter_ = communicator->createObjectAdapterWithEndpoints("","tcp -h 127.0.0.1 -p 10000");

adapter_ = communicator->createObjectAdapterWithEndpoints("","tcp -h ::1 -p 10000");

Many thanks in advance

Comments

  • benoit
    benoit Rennes, France
    Hi,

    You need to enclose the IPv6 address ::1 within quotes in the endpoint:
    adapter_ = communicator->createObjectAdapterWithEndpoints("","tcp -h \"::1\" -p 10000");
    

    If this isn't the problem, please copy/paste the exception or error messages that you get when calling this method.

    Cheers,
    Benoit.
  • benoit wrote: »
    Hi,

    You need to enclose the IPv6 address ::1 within quotes in the endpoint:
    adapter_ = communicator->createObjectAdapterWithEndpoints("","tcp -h \"::1\" -p 10000");
    

    If this isn't the problem, please copy/paste the exception or error messages that you get when calling this method.

    Cheers,
    Benoit.

    Hi Benoit,

    The strangest thing happened. I put in the quotes and got another error.
    Then I copied the line from your post and inserted it(looked the same as mine) and it worked.
    Guess that you must use the right quotes.
    Thanks for your help, tomorrow I will look into the quotes thing for now I stop because its 23:00 here.

    Regards
    SamboNB
  • benoit wrote: »
    Hi,

    You need to enclose the IPv6 address ::1 within quotes in the endpoint:
    adapter_ = communicator->createObjectAdapterWithEndpoints("","tcp -h \"::1\" -p 10000");
    

    If this isn't the problem, please copy/paste the exception or error messages that you get when calling this method.

    Cheers,
    Benoit.

    Any idea how it should work in combination of a config file.
    Client.Proxy=Server:tcp -h ::1 -p 10000
    nor
    Client.Proxy=Server:tcp -h \"::1\" -p 10000
    works here

    Regards
  • benoit
    benoit Rennes, France
    Hi,

    You need to escape the quotes in C++ or your code won't compile. You don't need however to escape the quotes in Ice configuration files, so you can just use:
    Client.Proxy=Server:tcp -h "::1" -p 10000
    

    Cheers,
    Benoit.
  • benoit wrote: »
    Hi,

    You need to escape the quotes in C++ or your code won't compile. You don't need however to escape the quotes in Ice configuration files, so you can just use:
    Client.Proxy=Server:tcp -h "::1" -p 10000
    

    Cheers,
    Benoit.

    Ok, I'm getting somewhere.
    Last obstacle: DNS error: Address family for hostname not supported host: ::1

    Some setting but where?

    Regards
    SamboNB
  • benoit
    benoit Rennes, France
    Hi,

    Did you set Ice.IPv6=1 to enable IPv6 support? The proxy and endpoint syntax is described here in the Ice manual.

    If you still get an exception after enabling IPv6 support, please copy/paste the full exception message.

    Cheers,
    Benoit.
  • Thanks

    Thanks it works, I just didn't know were to put the Ice.Ipv6=1

    Regards

    SamboNB