Results 1 to 5 of 5

Thread: At client site, how to set the timeout parameter for remote call?

  1. #1
    Jiangyubao is offline Registered User
    Name: Yubao Jiang
    Organization: www.gliet.edu.cn
    Project: integrate OSGi & Ice to provice service for PHP
    Join Date
    Oct 2007
    Location
    Beijing China
    Posts
    62

    At client site, how to set the timeout parameter for remote call?

    Hi, all.

    For example, I deploy a server application, and the service method is:

    void hello(){
    Thread.sleep(20000);//sleep 20 s
    }

    I use a client to connect to the server, and invoke the method, and I want to set the timeout parameter:
    if this call is not return in 1000ms, abandon this call, or throw a runtime exception.

    How to resolve this problem?

    Thanks!

  2. #2
    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
    Hi,

    You need to set a timeout on the proxy:

    Code:
       // C++
       proxy = proxy->ice_timeout(1000);
       proxy->hello();
    See the Ice manual for more information on timeouts.

    Cheers,
    Benoit.

  3. #3
    Jiangyubao is offline Registered User
    Name: Yubao Jiang
    Organization: www.gliet.edu.cn
    Project: integrate OSGi & Ice to provice service for PHP
    Join Date
    Oct 2007
    Location
    Beijing China
    Posts
    62
    Thanks for your reply.
    I have found it.

    Thanks!

  4. #4
    Jiangyubao is offline Registered User
    Name: Yubao Jiang
    Organization: www.gliet.edu.cn
    Project: integrate OSGi & Ice to provice service for PHP
    Join Date
    Oct 2007
    Location
    Beijing China
    Posts
    62
    Hi, how much is the default value of this timeout parameter?

  5. #5
    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
    See "Connection Timeouts" in the manual. The default is no timeout.

    Cheers,

    Michi.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Inaccuracy AMI call timeout
    By suds in forum Help Center
    Replies: 4
    Last Post: 10-27-2009, 02:00 PM
  2. how to set timeout for each call?
    By alexnycheung in forum Help Center
    Replies: 2
    Last Post: 07-28-2009, 04:56 PM
  3. Exception while async call timeout
    By Andrew S in forum Bug Reports
    Replies: 5
    Last Post: 10-28-2008, 06:22 PM
  4. inaccurate timeout in ice call
    By suds in forum Help Center
    Replies: 2
    Last Post: 10-14-2008, 05:17 AM
  5. how server to remote client.?
    By ouloba in forum Help Center
    Replies: 2
    Last Post: 10-17-2004, 10:27 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
  •