Results 1 to 4 of 4

Thread: asynchronous invocation doesn't work

  1. #1
    hui
    hui is offline Registered User
    Name: Fang Zhaohui
    Organization: Anhui University of Technology
    Project: Video Conferencing - RPC in video transcoding
    Join Date
    Sep 2011
    Posts
    11

    asynchronous invocation doesn't work

    Hi!

    I write a service using Icebox.
    In my service, I found that when proxies and servants are in the same communicator, the asynchronous invocation don't work.

    There is a simple example(Just add some code on demo-icebox).
    my Ice version: 3.4.2
    os: RedHat 5.0
    Linux kernel:2.6.18-8.el5

    example.zip

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

    This is the expected behavior: Ice does not currently support asynchronous proxy invocations on a collocated servant. You will need to disable collocation optimization on any proxy that is used for asynchronous invocations.

    Regards,
    Mark

  3. #3
    hui
    hui is offline Registered User
    Name: Fang Zhaohui
    Organization: Anhui University of Technology
    Project: Video Conferencing - RPC in video transcoding
    Join Date
    Sep 2011
    Posts
    11
    Quote Originally Posted by mes View Post
    Hi,

    This is the expected behavior: Ice does not currently support asynchronous proxy invocations on a collocated servant. You will need to disable collocation optimization on any proxy that is used for asynchronous invocations.

    Regards,
    Mark
    Thanks for your early reply!
    But there is another problem.
    In my application,some is in the same, other is not. If the proxies and servants are not in the same communicator,I will use async invocations. That means I must know whether proxies and servants are the same communicator! Is there any interfaces to do this? Determine whether proxies and servants are in the same communicator.

  4. #4
    mes's Avatar
    mes
    mes is online now ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,445
    The simplest solution is to completely disable collocation optimization in clients that make asynchronous invocations. You can disable it by setting Ice.Default.CollocationOptimized=0. If you still want to take advantage of collocation optimization for synchronous invocations, you can enable it on a per-proxy basis like this:

    Code:
    HelloPrx proxy = ...;
    proxy = proxy->ice_collocationOptimized(true);
    proxy->sayHello();
    Another solution is to leave it enabled by default and disable it individually for each proxy that you will use for asynchronous invocations:

    Code:
    HelloPrx proxy = ...;
    proxy = proxy->ice_collocationOptimized(false);
    proxy->begin_sayHello();
    Finally, you can trap CollocationOptimizationException and try again:

    Code:
    HelloPrx proxy = ...;
    while(true)
    {
        try
        {
            proxy->begin_sayHello();
            break;
        }
        catch(const Ice::CollocationOptimizationException&)
        {
            proxy = proxy->ice_collocationOptimized(false);
        }
    }
    Regards,
    Mark

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Asynchronous Method Invocation Samples
    By pradeep in forum Help Center
    Replies: 1
    Last Post: 11-23-2006, 04:55 AM
  2. My Ice Stats doesn't work??
    By billwillman in forum Help Center
    Replies: 6
    Last Post: 10-03-2006, 11:46 PM
  3. icepacknode doesn't work after reboot! help!
    By soloman817 in forum Help Center
    Replies: 4
    Last Post: 05-10-2005, 06:15 AM
  4. Asynchronous invocation
    By stephan in forum Help Center
    Replies: 5
    Last Post: 04-21-2004, 08:30 AM
  5. Documentation on Asynchronous Method Invocation
    By csapuntz in forum Help Center
    Replies: 1
    Last Post: 05-07-2003, 03:59 PM

Posting Permissions

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