Results 1 to 4 of 4

Thread: How do I run two services in a single 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

    How do I run two services in a single icebox?

    I'm using Windows 7 x64, .NET and the latest version of ICE (v3.4.1).

    How would I alter the demo in "C:\Ice-3.4.1-demos\democs\IceBox\hello" so that it ran two copies of the same service, one on port 10000, and one on port 20000?

  2. #2
    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
    Quote Originally Posted by Gravitas View Post
    I'm using Windows 7 x64, .NET and the latest version of ICE (v3.4.1).

    How would I alter the demo in "C:\Ice-3.4.1-demos\democs\IceBox\hello" so that it ran two copies of the same service, one on port 10000, and one on port 20000?
    Found the answer; posted it on: Using ICE from Zeroc, how do I configure Icebox in .NET to host two separate services? - Stack Overflow

  3. #3
    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,

    Welcome to our forums. It's good to see you were able to answer your own question .

    With the solution you posted, you are really running2 similar services in the same IceBox (Hello and Hello2).

    It's also possible to run the very same service twice--Hello and again Hello, with the very same DLL (same Slice definition, same object adapter name etc). Only the configuration must be slightly different, since the two services can't use the same port for their respective object adapter.

    Code:
    # 2 copies of the Hello service
     IceBox.Service.Hello=helloservice.dll:HelloServiceI --Ice.Config=config.service
     IceBox.Service.Hello2=helloservice.dll:HelloServiceI --Ice.Config=config2.service
    and in config2.service, you'd have:
    Code:
    Hello.Endpoints=tcp -p 20000:udp -p 20000:ssl -p 20001
    This works because by default IceBox creates a new Ice communicator for each service it loads. If you share the same communicator between your IceBox services, you could not use the same object adapter name (here "Hello") for multiple object adapters within this communicator.

    Best regards,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  4. #4
    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
    Quote Originally Posted by bernard View Post
    It's also possible to run the very same service twice--Hello and again Hello, with the very same DLL (same Slice definition, same object adapter name etc). Only the configuration must be slightly different, since the two services can't use the same port for their respective object adapter.
    You are so correct, I've just tested it and it works beautifully. I've added a link to stackoverflow.com pointing back to this answer.

    By the way - congratulations on building such a beautifully designed product. I know elegant architecture when I see it. As one of my friends said, "ICE is a pleasure to code with".

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. IceBox + services in subfolders
    By dmitry.medvedev in forum Help Center
    Replies: 3
    Last Post: 10-10-2008, 02:30 AM
  2. invocation between two services in the IceBox
    By drumnbass in forum Help Center
    Replies: 3
    Last Post: 03-05-2008, 06:32 AM
  3. IceBox Determining Dependent Services
    By Sameerrele in forum Help Center
    Replies: 2
    Last Post: 09-25-2006, 12:59 PM
  4. Purify and IceBox services
    By xdm in forum Help Center
    Replies: 4
    Last Post: 06-07-2006, 03:59 PM
  5. Share endpoint between services in IceBox
    By rspivak in forum Help Center
    Replies: 2
    Last Post: 04-14-2006, 06:18 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
  •