boost::asio::ip::tcp::socket is connected?
问题 I want to verify the connection status before performing read/write operations. Is there a way to make an isConnect() method? I saw this, but it seems "ugly". I have tested is_open() function as well, but it doesn't have the expected behavior. 回答1: TCP is meant to be robust in the face of a harsh network; even though TCP provides what looks like a persistent end-to-end connection, it's all just a lie, each packet is really just a unique, unreliable datagram. The connections are really just