Results 1 to 3 of 3

Thread: Get all endpoint IPs Programmatically from Ice Connection

  1. #1
    shiv is offline Registered User
    Name: Shivkumar Shivaji
    Organization: Mylife
    Project: Search
    Join Date
    May 2009
    Posts
    6

    Get all endpoint IPs Programmatically from Ice Connection

    I have an ice grid locator which for example supports the following proxy group name Name@ProxyGroup. This can resolve to potential hosts
    H1, H2, H3, H4

    Is there a way to programmatically get H1,H2,H3,H4 from the ice connection. I ran a debugger and noted that iceProxy._locatorInfo._table._adapterEndpointsTabl e[0].value.endpoints[1-n]._host contains this information. However, I am not sure how to get this programmatically.

    Thanks, Shiv

  2. #2
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Hi,

    You can't get these endpoints directly. Instead, you would need to call on the IceGrid locator interface to retrieve the endpoints, for example:

    Code:
       Ice::ObjectPrx proxy = communicator->getDefaultLocator()->findAdapterById("ProxyGroup"); 
       Ice::EndpointSeq endpoints = proxy->ice_getEndpoints();
    Then, you can go through the stringified endpoints and extract the host information.

    Note that the IceGrid locator might not necessarily return all the endpoints of the replica group, how many endpoints are returned depends on the n-replicas configuration of your replica group, see here for more information on this attribute.

    I'm curious as to why you need to get the IP address of each replicas. Is this to invoke on each replica individually? In this case, it might be better to use the findAllReplicas method of the IceGrid::Query interface to retrieve the proxies of each replica for a given replicated proxy.

    Cheers,
    Benoit.

  3. #3
    shiv is offline Registered User
    Name: Shivkumar Shivaji
    Organization: Mylife
    Project: Search
    Join Date
    May 2009
    Posts
    6
    Sorry for the late reply. I missed that you had asked a question in the response to me.

    Your suggestion works well. The reason we are considering each endpoint individually is so that we can have more control in scenarios where an endpoint might degrade in performance but not degrade to the extent that the ice grid will decommision an endpoint.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 12
    Last Post: 12-04-2008, 11:05 AM
  2. Create icegridnode programmatically
    By labesta in forum Help Center
    Replies: 1
    Last Post: 07-07-2008, 01:30 PM
  3. Replies: 14
    Last Post: 05-05-2008, 03:25 AM
  4. Shut down the Icepatch2 Server programmatically
    By Ewgenijkkg in forum Help Center
    Replies: 7
    Last Post: 06-14-2007, 08:45 PM
  5. Using Properties Programmatically
    By Oleh Babyak in forum Help Center
    Replies: 1
    Last Post: 11-22-2006, 11:33 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
  •