My client application uses a boost::asio::ip::tcp::socket to connect to a remote server.
If the app loses connection to this server (e.g. due to the server cras
I've done something similar using Boost.Asio in the past. I use the asynchronous methods, so a reconnect is typically letting my existing ip::tcp::socket object go out of scope, then creating a new one for calls to async_connect. If async_connect fails, I use a timer to sleep a bit then retry.