Results 1 to 6 of 6

Thread: Multiple Connection to the same Glacier

  1. #1
    paolo is offline Registered User
    Name: paolo volpi
    Organization: tvblob
    Project: tvblob blobbox
    Join Date
    Aug 2007
    Posts
    22

    Multiple Connection to the same Glacier

    Hi,
    for testing reasons, I need to create multiple connection to the same glacier (with different credentials) from the same application. That to simulate more clients from a single app, I want to do that with only one comunicator or scalability reasons, Is it possible?
    Thanks

  2. #2
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055
    I don't see why not. You can create several sessions with different credentials from a single client. No need to use several communicators, as far as I can see.

    Cheers,

    Michi.

  3. #3
    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
    Note that you'll need to use distinct router proxies for each Glacier2 session (with each proxy using a unique connection). So you'll need to set the router proxy and connection ID on each proxy obtained from Glacier2. For example:

    Code:
        Glacier2::RouterPrx router1 = Glacier2::RouterPrx::uncheckedCast(router->ice_connectionId("router1"));
        Glacier2::RouterPrx router2 = Glacier2::RouterPrx::uncheckedCast(router->ice_connectionId("router2"));
    
        base = router1->createSession("client1", "test1");
        Glacier2::SessionPrx session1 = base->ice_connectionId("router1")->ice_router(router1);
    
        base = router2->createSession("client2", "test2");
        Glacier2::SessionPrx session2 = base->ice_connectionId("router2")->ice_router(router2);
    This ensures that invocations on the session1 proxy are routed with router1 using the connection "router1" and that invocations on the session2 proxy are routed with router2 using the connection "router2".

    Cheers,
    Benoit.

  4. #4
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    I've attached part of a test which uses this technique that I used to test Glacier2 scalability in conjunction with IceStorm in the Ice 3.3 testing cycle. This subscriber can be used with demo/IceStorm/clock.

    The config.sub file from demo/IceStorm/clock must also be modified. Add, with suitable changes:

    Router=DemoGlacier2/router:tcp -p 10005 -h june
    Ice.ACM.Client=0
    Ice.RetryIntervals=-1

    In addition, Clock.Subscriber.Endpoints must be commented out or removed
    Attached Files Attached Files

  5. #5
    phil++ is offline Registered User
    Name: Philip Kovacs
    Organization: University of Pennsylvania
    Project: Ice Storm Evaluation
    Join Date
    Jul 2007
    Posts
    24
    I'd like to continue this thread with a follow-up question.

    If my application needs to create multiple, independent connections to the same Glacier2 router, is there any way to share the same object adapter for servants or am I required to create a "dedicated" object adapter for each router session?

    I note in Matthew's Subscriber.cpp attachment his use of the

    createObjectAdapterWithRouter() api, with one adapter being creating for each router connection/session.

    I'm curious is this is a fundamental restriction at this point in time.

    Thanks,

    Phil

  6. #6
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    Yes, that is a restriction.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Connection through Glacier not working
    By DLow in forum Help Center
    Replies: 3
    Last Post: 09-01-2010, 08:19 PM
  2. Replies: 2
    Last Post: 03-19-2009, 04:52 AM
  3. Connection through multiple Glacier routers
    By volka in forum Help Center
    Replies: 2
    Last Post: 01-06-2009, 05:19 AM
  4. multiple threads, single connection problem
    By ywtsang in forum Help Center
    Replies: 6
    Last Post: 07-15-2008, 12:12 PM
  5. [freeze] one connection with multiple maps?
    By fanson in forum Help Center
    Replies: 0
    Last Post: 09-28-2007, 05:53 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
  •