Archived

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

Endpoint Specifications

I have just gotten started with ICE but I have read quite alot of the documentation available already and built the tutorials. ICE professes to be an easy replacement for CORBA and from the looks of it that seems to be the case.

However, there is one thing that seems to be conspicuously absent from the examples and documentation. That is a good treatment of endpoint strings.

All the samples I have seen so far show endpoint strings of the form:

"default -p 10000"

This is all well and good if all you ever want to do is use your ICE solution locally on one machine, but RPC is about distributed computing.

How the heck do you specify that you want an ICE component to listen on something like 203.202.121.44:1000 versus 0.0.0.0:1000 so you can actually see two machines communicating over the internet?

Comments

  • xdm
    xdm La Coruña, Spain
    Hi Steve,

    Welcome to our forums
    How the heck do you specify that you want an ICE component to listen on something like 203.202.121.44:1000 versus 0.0.0.0:1000 so you can actually see two machines communicating over the internet?

    you should use -h option
    tcp -h 203.202.121.44 -p 1000
    

    See section 32.4.6 Endpoints for detailed documentation about adapter endpoints
    http://www.zeroc.com/doc/Ice-3.3.0-IceTouch/manual/Adv_server.33.4.html

    For a complete reference of endpoints options see
    http://www.zeroc.com/doc/Ice-3.3.0-IceTouch/manual/ProxyEndpointRef.51.2.html

    Regards,
    José
  • Endpoints Documentation

    I tried that using the following:

    -- Relevant client side code in C# ----
    ic = Ice.Util.initialize(ref args);
    Ice.ObjectPrx obj = ic.stringToProxy("SimplePrinter:tcp -h integrityintegrators.net -p 10000");

    PrinterPrx printer = PrinterPrxHelper.checkedCast(obj);
    if (printer == null)
    throw new ApplicationException("Invalid proxy");

    printer.printString("Hello World!");
    End client side code

    -- Relevant server side code in C++
    ic = Ice::initialize(argc, argv);
    Ice::ObjectAdapterPtr adapter
    = ic->createObjectAdapterWithEndpoints(
    "SimplePrinterAdapter", "tcp -h integrityintegrators.net -p 10000
    End Server side code

    When I run the client, I get the following exception:


    Ice.ConnectionRefusedException
    error = 0
    at IceInternal.ProxyFactory.checkRetryAfterException(LocalException ex, Refer
    ence ref, OutgoingAsync outAsync, Int32& cnt) in d:\builds\distbuilds\release\Ic
    e-3.3.0\cs\src\Ice\ProxyFactory.cs:line 196
    at Ice.ObjectPrxHelperBase.handleException__(ObjectDel_ delegate, LocalExcept
    ion ex, OutgoingAsync outAsync, Int32& cnt) in d:\builds\distbuilds\release\Ice-
    3.3.0\cs\src\Ice\Proxy.cs:line 880
    at Ice.ObjectPrxHelperBase.ice_isA(String id__, Dictionary`2 context__, Boole
    an explicitContext__) in d:\builds\distbuilds\release\Ice-3.3.0\cs\src\Ice\Proxy
    .cs:line 170
    at Ice.ObjectPrxHelperBase.ice_isA(String id__) in d:\builds\distbuilds\relea
    se\Ice-3.3.0\cs\src\Ice\Proxy.cs:line 139
    at Demo.PrinterPrxHelper.checkedCast(ObjectPrx b) in C:\Documents and Setting
    s\X042530\My Documents\Visual Studio 2005\Projects\MSC\demoClient\demoClient\Pri
    nter.cs:line 107
    at demoClient.Program.Main(String[] args) in C:\Documents and Settings\X04253
    0\My Documents\Visual Studio 2005\Projects\MSC\demoClient\demoClient\Program.cs:
    line 18
    Caused by: System.Net.Sockets.SocketException: No connection could be made becau
    se the target machine actively refused it
    at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
    at IceInternal.Network.doEndConnectAsync(IAsyncResult result) in d:\builds\di
    stbuilds\release\Ice-3.3.0\cs\src\Ice\Network.cs:line 684
  • matthew
    matthew NL, Canada
    Looks like a firewall issue. Is the port accessible? Did you try telnet integrityintegrators.net 10000 and see if you get a connection? You can enable the configuration property Ice.Trace.Network=1 (or 2 or 3 if you want more information) to get debugging information in your applications.

    See http://www.zeroc.com/faq/connectionRefusedException.html for more information.
  • Endpoints

    I am not sure what is going on, will try testing from different place. I even tried configuring it to listen on port 80 which is known to be accessible, when the web server is up, and still no luck.

    Telneting in with putty produces connection refused when accessing the ICE thinglet (can't remember your word for it at the moment but I want to call it a cube as in ice cube, kind of like java bean).
  • matthew
    matthew NL, Canada
    If you use Ice.Trace.Network you can find out what IP & port the service is actually listening on. If its listening on the correct IP & port, and its inaccessible then you know it must be a firewall issue.
  • Ice.Trace.Network

    Apparently it was a firewall issue, because when I tried from a location not behind the firewall, the application worked like a charm.

    Now I guess I need to get my head around glacier so that things can work as expected even behind a firewall.

    By the way, I have to say that Ice is cool!
  • matthew
    matthew NL, Canada
    Note that Glacier2 isn't required to traverse firewalls, however, if you have many objects behind the firewall it makes your life much simpler. I recommend reading Michi's article on Glacier2 in Issue 22 of Connections. http://www.zeroc.com/newsletter/issue22.pdf
  • Traversing firewalls

    If glacier is not needed for traversing firewalls, then what would be the simplest path to solving this problem. I would like to just do some prototyping and not get bogged down in unneeded complexity for the moment.

    Also what is your policy toward allowing others to write articles on your technology, I figure that since I am a pretty good writer, and would like to get my name out there more, if you have a need for more tutorials and articles, maybe we can work something out.
  • xdm
    xdm La Coruña, Spain
    If glacier is not needed for traversing firewalls, then what would be the simplest path to solving this problem.

    The simplest is to configure your firewall to allow connections to the server address and port

    You would also need to do this even if using Glacier2.

    To know more about Glacier2 read http://www.zeroc.com/doc/Ice-3.3.0/manual/Glacier2.40.2.html

    Let us know if you need more help with that.

    Regards,
    José
  • bernard
    bernard Jupiter, FL
    Hi Steve,

    Let me try to clarify. Say you have one client and one server on separate networks, with one or more firewalls in between. To go through this (these) firewall, there are two possibilities:

    - Your client and server talk directly to each other, through an open port on your server-side firewall. If this firewall is not on the same machine as your server, then you will need some extra configuration if your server creates proxies and pass them to the client. See http://www.zeroc.com/faq/configurationForNAT.html

    - You install an intermediate server (the "Glacier2 router") between your client and your server. Since the Glacier2 router is an Ice server, it's similar to the situation above: you client will talk to the Glacier2 router "through" the firewall, and the Glacier2 router will forward the request to your server. With this setup, you only need to open one port on your firewall for any number of servers behind the firewall; and Glacier2 also provides additional features such as session management, authentication, etc.
    Also what is your policy toward allowing others to write articles on your technology, I figure that since I am a pretty good writer, and would like to get my name out there more, if you have a need for more tutorials and articles, maybe we can work something out.

    We welcome all articles, tutorials etc. about Ice: please go ahead!

    Thanks,
    Bernard