27constexpr auto IdleTimeout = 5
s;
32 using AutoUnlinkOption = boost::intrusive::link_mode<boost::intrusive::auto_unlink>;
35 template <
typename Endpo
intT>
42 tmr_ =
r.timer(now.
mono_time() + IdleTimeout, Priority::Low,
50 boost::intrusive::list_member_hook<AutoUnlinkOption> list_hook;
67 auto fn = [fd](std::string_view
line) {
72 throw runtime_error{
"partial write"};
79 tmr_ = reactor_.timer(now.
mono_time() + IdleTimeout, Priority::Low,
82 }
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>;
116 const auto now = CyclTime::current();
117 conn_list_.clear_and_dispose([now](
auto*
conn) {
conn->dispose(now); });
127 auto*
const conn =
new EchoConn{now, reactor_, std::move(
sock),
ep};
128 conn_list_.push_back(*
conn);
172 }
catch (
const std::exception& e) {