thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nevo Hed <>
Subject Re: thrift c++ client and recovering connection
Date Fri, 18 Jul 2014 16:55:49 GMT
Hi Denis

I don't know whats the "right" way, but I know that I recreate the whole
stack on a reconnection

   sock = boost::shared_ptr<TSocket> socket(new TSocket(..., ...));
   trans = boost::shared_ptr<TTransport>(new TFramedTransport(sock));
   boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(trans));
   client = boost::shared_ptr<MyClient>(new MyClient(protocol));

On Thu, Jul 17, 2014 at 7:01 PM, Denis Samoilov <> wrote:

> hi community,
> currently i use per call connection but due increase of communication
> thinking to move to the model with always open connection. In this case I
> need to handle situation when connection is lost and reopen it.
> What is right way to do this? Do I need to recreate client after connection
> lost? Because simply transport->open() does not work. Also, what would be
> correct exception to catch (currently i think to reconnect on any
> exception)?
> Thank you!

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