Results 1 to 3 of 3

Thread: Is there AMI style ice_getConnection?

  1. #1
    rolandsun is offline Registered User
    Name: roland sun
    Organization: metstar
    Project: weather radar product generation software
    Join Date
    Sep 2008
    Location
    beijing
    Posts
    9

    Is there AMI style ice_getConnection?

    I try to combine Bidirectional Connections and AMI in my project , I use the QtDispatcher atrributted by alex, and I try to avoid deadlock by using begin_xx end_xx AMI call ,and uncheckCast.. , everything works well except the ice_getConnection is called during
    Code:
     adapter->activate();
        proxy->ice_getConnection()->setAdapter(adapter);
        proxy->addClient(ident);
    it seems to hang,and I can not find the begin_ice_getConnect() in ICE's api,how can I fix or avoid it?

  2. #2
    mes's Avatar
    mes
    mes is offline ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,445
    Hi Roland,

    As you suspected, calling ice_getConnection behaves similarly to making a synchronous proxy invocation, in that calling it from the Qt dispatch thread will cause the program to hang.

    The proxy also provides the method ice_getCachedConnection, but this method returns null if no connection has been established yet.

    To avoid blocking, I recommend calling begin_ice_ping. Upon successful completion, the connection will be established and you can do something like this in the completion callback:
    Code:
    Ice::ConnectionPtr conn = proxy->ice_getCachedConnection();
    assert(conn);
    conn->setAdapter(...);
    We'll consider adding a better solution to a future Ice release.

    Regards,
    Mark

  3. #3
    rolandsun is offline Registered User
    Name: roland sun
    Organization: metstar
    Project: weather radar product generation software
    Join Date
    Sep 2008
    Location
    beijing
    Posts
    9
    Thanks Mark, I think it's the best solution we can figure out right now.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 12-19-2009, 08:59 AM
  2. Can I safely skip AMD invocation style response
    By aozarov in forum Help Center
    Replies: 5
    Last Post: 04-09-2008, 05:12 PM
  3. AMI or not AMI depending on slice args?
    By stepancheg in forum Help Center
    Replies: 2
    Last Post: 02-26-2008, 03:00 PM
  4. Help : AMI
    By mykael in forum Help Center
    Replies: 7
    Last Post: 06-22-2006, 12:23 PM
  5. To be cool like Matthew's hair style
    By OrNot in forum Comments
    Replies: 0
    Last Post: 10-04-2005, 11:12 AM

Tags for this Thread

Posting Permissions

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