Archived

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

Alias name for dynamic created servers

Hello,
I wonder if there is any Ice service for translating the server tuple (host, port) into a name "randomServerName", being this servers created dynamically and each server serving just one client.

In order to explain better what I need I will explain how an iteration of my program works:

  • User starts server on my webpage.
  • Ice server starts with a host and a port.
  • Webpage returns IP and port of the Ice Server created.
  • User connects its robot to the given IP and port.
  • When the connection ends the server is shutdown.

What I want to achieve is to alias host and port binding them to a name, I want to get something similar to topicNames in IceStorm, in which the client connects to a central manager knowing its host and port and then use a name to identify which server to communicate with but with no need to know the host and port of the latests.

I thought on using IceGrid as a DNS for this purpose but after playing with the IceGrid demos I think it cannot fit for this task because of the following:

  • Can I decide the DNS name of the server on the startup of the server rather than on the application.xml file?
  • Can I IceGrid wait for a server to request to be registered in the DNS?

I don't know if this can be achieved with IceGrid or its there's a better way to solve this.
Thank you for your answers.

Tagged:

Comments

  • benoit
    benoit Rennes, France

    Hi Adrian,

    I believe you can use IceGrid for your application but you might indeed end up not using the XML descriptors.

    Deploying an application with XML descriptors is easy but it's not the only way to specify an application with its nodes and servers. You can also do it programatically using the IceGrid::Admin Slice interface and the Slice descriptor types.

    See the documentation for the following Slice types:

    We don't have examples showing how to use these but you could check out our IceGrid tests for some examples, for instance the IceGrid/update shows how to add/update/remove applications and servers programatically.

    For your use case, your web application would connect to IceGrid administrative interface and add/remove servers from a well-known application. This server would provide an object adapter with a specific AdapterId that can be used to access the server using indirect proxies (containing a symbolic name) instead of direct proxies (containing host and port).

    Let us know if you need more information on this.

    Cheers,
    Benoit.