Results 1 to 5 of 5

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

  1. #1
    Gravitas is offline Registered User
    Name: Shane Tolmie
    Organization: NeuralFutures LLC
    Project: Server modules in C++, C# and Java, to client.
    Join Date
    Feb 2011
    Posts
    40

    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?

    Notes:

    • 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.
    Last edited by Gravitas; 03-11-2011 at 08:10 AM.

  2. #2
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Hi Shane,

    Thank you for pointing out this issue with the manual. You can simply delete:

    Code:
            <property name="Glacier2.Admin.Endpoints"
                      value="tcp ‑h 127.0.0.1"/>
            <property name="Glacier2.Admin.RegisterProcess"
                      value="1"/>
    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:
    Code:
     <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,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  3. #3
    Gravitas is offline Registered User
    Name: Shane Tolmie
    Organization: NeuralFutures LLC
    Project: Server modules in C++, C# and Java, to client.
    Join Date
    Feb 2011
    Posts
    40
    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:

    Code:
    !! 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 Client.App.run(String[] 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):

    Code:
    Hello.Proxy=hello
    Ice.Default.Locator=DemoIceGrid/Locator:default -h 127.0.0.1 -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):

    Code:
    Hello.Proxy=hello
    Ice.Default.Locator=DemoIceGrid/Locator:default -h 127.0.0.1 -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).
    Last edited by Gravitas; 03-13-2011 at 01:51 PM.

  4. #4
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    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!

    Cheers,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  5. #5
    Gravitas is offline Registered User
    Name: Shane Tolmie
    Organization: NeuralFutures LLC
    Project: Server modules in C++, C# and Java, to client.
    Join Date
    Feb 2011
    Posts
    40
    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).

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 06-22-2009, 08:15 AM
  2. Replies: 1
    Last Post: 06-09-2009, 10:53 PM
  3. Replies: 1
    Last Post: 01-28-2009, 06:15 AM
  4. Replies: 1
    Last Post: 05-07-2008, 05:56 PM
  5. Replies: 11
    Last Post: 12-06-2005, 06:52 AM

Posting Permissions

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