You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Eastdawn Yang <ea...@gmail.com> on 2012/03/14 10:14:31 UTC

Is there a way to customize timeout for RPC call at client side?

Hello people,

Is there built-in support in thrift to set timeout value for non-oneway RPC
call at client side?
For example, client->ping() will throw TException when timing out.

Regards.
Tiger

Re: Is there a way to customize timeout for RPC call at client side?

Posted by Eastdawn Yang <ea...@gmail.com>.
On Thu, Mar 15, 2012 at 12:32 AM, Rush Manbert <ru...@manbert.com> wrote:

>
> On Mar 14, 2012, at 2:14 AM, Eastdawn Yang wrote:
>
> > Hello people,
> >
> > Is there built-in support in thrift to set timeout value for non-oneway
> RPC
> > call at client side?
> > For example, client->ping() will throw TException when timing out.
> >
> > Regards.
> > Tiger
>
> For C++ (that's what client->ping() looks like), TSocket.h declares these
> methods:
>
>  /**
>   * Set the connect timeout
>   */
>  void setConnTimeout(int ms);
>
>  /**
>   * Set the receive timeout
>   */
>  void setRecvTimeout(int ms);
>
>  /**
>   * Set the send timeout
>   */
>  void setSendTimeout(int ms);
>
>  /**
>   * Set the max number of recv retries in case of an EAGAIN
>   * error
>   */
>  void setMaxRecvRetries(int maxRecvRetries);
>
> - Rush


Thank you very much, Rush!

Best Regards.
Tiger

Re: Is there a way to customize timeout for RPC call at client side?

Posted by Rush Manbert <ru...@manbert.com>.
On Mar 14, 2012, at 2:14 AM, Eastdawn Yang wrote:

> Hello people,
> 
> Is there built-in support in thrift to set timeout value for non-oneway RPC
> call at client side?
> For example, client->ping() will throw TException when timing out.
> 
> Regards.
> Tiger

For C++ (that's what client->ping() looks like), TSocket.h declares these methods:

  /**
   * Set the connect timeout
   */
  void setConnTimeout(int ms);

  /**
   * Set the receive timeout
   */
  void setRecvTimeout(int ms);

  /**
   * Set the send timeout
   */
  void setSendTimeout(int ms);

  /**
   * Set the max number of recv retries in case of an EAGAIN
   * error
   */
  void setMaxRecvRetries(int maxRecvRetries);

- Rush