thank you! this is what I do now but decided to check that i do not miss simpler way. On July 18, 2014 at 9:59:23 AM, Nevo Hed ([email protected]) wrote:
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 <[email protected]> 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! >
