refactor
This commit is contained in:
@@ -45,10 +45,6 @@ auto is_socket_still_alive(boost::asio::ip::tcp::socket &sock) -> bool {
|
|||||||
non_blocking_guard guard{sock};
|
non_blocking_guard guard{sock};
|
||||||
|
|
||||||
boost::system::error_code err{};
|
boost::system::error_code err{};
|
||||||
std::array<std::uint8_t, 1> tmp{};
|
|
||||||
auto available = sock.receive(boost::asio::buffer(tmp),
|
|
||||||
boost::asio::socket_base::message_peek, err);
|
|
||||||
|
|
||||||
if (err == boost::asio::error::would_block ||
|
if (err == boost::asio::error::would_block ||
|
||||||
err == boost::asio::error::try_again) {
|
err == boost::asio::error::try_again) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user