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

Problem with connecting via Glacier2 in the demo "Icegrid\Icebox" ...

The demo in "Ice-3.4.1\Ice-3.4.1-demos\democs\IceGrid\icebox" runs Glacier2, within IceGrid, as part of the demo.

Currently, the client cannot connect to the Glacier2 port (on port 4063), as the Glacier2 setup in the application.xml file is not set up properly for this.

What changes would I have to make to application.xml to allow the client to connect via Glacier2 on port 4063, rather than directly to IceGrid on port 4061?

  • The reason this is important is that I would like to test this demo by connecting Local PC / Remote PC via the internet.
  • I've tried following the instructions in the ICE user manual v4.3.1, under "IceGrid" and the section "38.15.5 Deploying a Router", however, if trace is turned on it says that a number of the settings specified in the .xml file have been depreciated.


  • bernard
    bernard Jupiter, FL
    Hi Shane,

    Thank you for pointing out this issue with the manual. You can simply delete:
            <property name="Glacier2.Admin.Endpoints"
                      value="tcp &#8209;h"/>
            <property name="Glacier2.Admin.RegisterProcess"

    or use templates.xml.
    What changes would I have to make to application.xml to allow the client to connect via Glacier2 on port 4063, rather than directly to IceGrid on port 4061?

    You need to update the client-endpoints value on this line:
     <server-instance template="Glacier2" instance-name="DemoGlacier2" client-endpoints="tcp -h localhost -p 4063" server-endpoints="tcp">

    You may also want to update server-endpoints to use localhost (tcp -h localhost) instead of listening on all interfaces.

    Best regards,
  • Thank you for your reply.

    The client is still unable to connect to the Glacier2 router.

    I updated the demo in "Ice-3.4.1-demos\democs\IceGrid\icebox" as per your instructions.

    Now, if I alter "config.client" to connect through the Glacier2 firewall, I get the following error:
    !! 3/13/2011 17:41:36:779 client.exe: error: Ice.ConnectionLostException
           error = 0
          at IceInternal.ProxyFactory.checkRetryAfterException(LocalException ex, Reference ref, Boolean sleep, Int32& cnt) in c:\Ice-Build\VC9\Rele
    roxyFactory.cs:line 212
          at Ice.ObjectPrxHelperBase.handleException__(ObjectDel_ delegate, LocalException ex, Boolean sleep, Int32& cnt) in c:\Ice-Build\VC9\Releas
    xy.cs:line 2340
          at Demo.HelloPrxHelper.sayHello(Dictionary`2 context__, Boolean explicitContext__) in C:\Program Files (x86)\ZeroC\Ice-3.4.1\Ice-3.4.1-dem
    d\icebox\Hello.cs:line 180
          at Demo.HelloPrxHelper.sayHello() in C:\Program Files (x86)\ZeroC\Ice-3.4.1\Ice-3.4.1-demos\democs\IceGrid\icebox\Hello.cs:line 149
          at[] args) in C:\Program Files (x86)\ZeroC\Ice-3.4.1\Ice-3.4.1-demos\democs\IceGrid\icebox\Client.cs:line 39
          at Ice.Application.doMain(String[] args, InitializationData initializationData) in c:\Ice-Build\VC9\Release\cs\src\Ice\Application.cs:line
       Caused by: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
          at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
          at IceInternal.TcpTransceiver.finishRead(Buffer buf) in c:\Ice-Build\VC9\Release\cs\src\Ice\TcpTransceiver.cs:line 296

    Here is the original version of "config.client" that works 100% (its not connecting through the Glacier2 firewall):
    Ice.Default.Locator=DemoIceGrid/Locator:default -h -p 4061

    Here is the new version of "config.client" that throws the exception above (since Glacier2 is on port 4063, I assume that changing the port to 4063 should make it connect through Glacier2):
    Ice.Default.Locator=DemoIceGrid/Locator:default -h -p 4063

    Notes: Glacier2 is definitely running within IceGrid, as I changed the "activation" property to "always" (it was on "manual" which means that the Glacier2 router does not even run by default).
  • bernard
    bernard Jupiter, FL
    Unfortunately, this demo does not show how write a client that talks to an IceBox server through Glacier2.

    It just shows:
    - how to start a Glacier2 router through IceGrid
    - how to manage an IceBox server from the graphical IceGrid Admin, when IceGrid Admin connects directly to the IceGrid registry or indirectly through this Glacier2 router

    To do what you want, you need to update the client to create a Glacier2 session and connect through Glacier--like any client using Glacier2 would. In this setup, the client does not talk directly to IceGrid, and should not configure Ice.Default.Locator. It's the Glacier2 router that uses IceGrid to resolve indirect proxies provided by the client.

    Here, when IceGrid starts the Glacier2 router, it configures automatically Ice.Default.Locator. If you didn't use IceGrid to start your Glacier2 router, you would need to set Ice.Default.Locator yourself in the Glacier2 router config file.

    I hope this is clearer now!

  • Thank you for your reply. Try as I might, I just couldn't get Icegrid to work with Glacier2.

    However, I have a nicely working solution for now: everything is a separate console based .exe, which makes for much easier debugging. I am basing my project on the Glacier2/callback demo. Once everything is working nicely, I can either look at rolling it all into IceBox, or just write my own GUI in C# to start/stop/monitor the services (the Ice manual is very good, and describes how to write your own endpoint registry).

    As I have a solution, the case is closed (for now at least).