27constexpr auto PingInterval = 100ms;
32 using AutoUnlinkOption = boost::intrusive::link_mode<boost::intrusive::auto_unlink>;
36 : sock_{
std::move(sock)}
48 boost::intrusive::list_member_hook<AutoUnlinkOption> list_hook;
65 auto fn = [
this](std::string_view
line) {
76 }
catch (
const std::exception& e) {
84 if (sock_.send(
"ping\n", 5, 0) < 5) {
85 throw runtime_error{
"partial write"};
87 }
catch (
const std::exception& e) {
103 using ConstantTimeSizeOption = boost::intrusive::constant_time_size<false>;
104 using MemberHookOption = boost::intrusive::member_hook<EchoConn,
decltype(EchoConn::list_hook),
105 &EchoConn::list_hook>;
106 using ConnList = boost::intrusive::list<EchoConn, ConstantTimeSizeOption, MemberHookOption>;
120 const auto now = CyclTime::current();
121 conn_list_.clear_and_dispose([now](
auto*
conn) {
conn->dispose(now); });
127 if (
sock.is_ip_family()) {
139 auto*
const conn =
new EchoConn{now, reactor_, std::move(
sock),
ep};
140 conn_list_.push_back(*
conn);
150 if (!conn_list_.empty() || inprogress_) {
153 if (aifuture_.valid()) {
160 }
catch (
const std::exception& e) {
168 if (!
connect(now, reactor_, ep_)) {
178 bool inprogress_{
false};
221 }
catch (
const std::exception& e) {