thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vivek Goel <goelvivek2...@gmail.com>
Subject Re: Recv timeout not working
Date Fri, 15 Mar 2013 06:01:44 GMT
Can you please tell how can I enable it?
I didn't find any property for class TSocket.

regards
Vivek Goel


On Thu, Mar 14, 2013 at 1:10 AM, Ben Craig <ben.craig@ni.com> wrote:

> I think I've heard of this problem before, and I think the fix was to turn
> on keep alive.  I don't think there are existing hooks for that in thrift
> though.  Turning on keepalive should also make your clients throw an
> exception much faster than one hour.
>
>
>
> From:   Vivek Goel <goelvivek2011@gmail.com>
> To:     user@thrift.apache.org,
> Date:   03/13/2013 01:50 PM
> Subject:        Recv timeout not working
>
>
>
> I am using thrift C++ library at  both end  server and client.
>
> I am facing problem with recv timeout. I am setting a one hour value for
> recv timeout. But it is not working, clients are infinitely waiting on
> server restart.
>
>
> My code is:
>
> ----------------------------------------------------------------------------------------
> boost::shared_ptr<TSocket> socket = boost::shared_ptr<TSocket>(
>         new TSocket(server_host_, server_port_));
>     socket->setConnTimeout(ThriftConf::connection_timeout_);
>     socket->setRecvTimeout(ThriftConf::recv_timeout_);
>     socket->setSendTimeout(ThriftConf::send_timeout_);
>     boost::shared_ptr<TTransport> tr =
> boost::shared_ptr<TBufferedTransport>(
>         new TBufferedTransport(socket));
>     boost::shared_ptr<TBinaryProtocol> p =
> boost::shared_ptr<TBinaryProtocol>(
>         new TBinaryProtocol(tr));
>
>
> ----------------------------------------------------------------------------------------------------
>
> Where values are:
> (gdb) print ThriftConf::connection_timeout_
> $1 = 360000
> (gdb) print ThriftConf::recv_timeout_
> $2 = 3600000
> (gdb) print ThriftConf::send_timeout_
> $3 = 180000
>
>
> regards
> Vivek Goel
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message