Our Windows client applications connects to a server on the same LAN via the function boost::asio::ip::tcp::socket::async_connect like so:
std::string ip, port;
boost::asio::io_service io;
boost::asio::ip::tcp::socket client( io );
boost::asio::ip::tcp::endpoint endpoint( boost::asio::ip::address::from_string( ip ), port );
// synchronous. (Does not return in problematic case and callback not called)
client.async_connect( endpoint, boost::bind(&CallbackFunction, this, ip, port, boost::asio::placeholders::error ) );
Occasionally, and ever so randomly, one client will fails to reach the server no matter how many times the client is restarted. The only solution is to reboot the workstation (Windows 7 or 10). I am at loss as to the reason for this intermittent failure given that the client and server are on the same LAN and other clients on the LAN are able to connect to the server. Could it be some local route that's been cached? If so is there a command that I can run in the terminal to flush the route or release the appropriate system resources.