thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nevo Hed <nhed+thrift...@aereo.com>
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

i.e.:
   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));
   trans->open();



On Thu, Jul 17, 2014 at 7:01 PM, Denis Samoilov <samoilov@gmail.com> 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!
>

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