Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 mio 中编写了一个 TCP 服务器并注册了多个超时,但只有最后一次注册的超时触发。我的超时是否需要一个包装器来组合它们,或者是否有任何其他方法可以在 mio v0.5 中注册多个超时?
我注册了一个带有 id 的元组
event_loop.timeout_ms((id, ServerTimeout::T1(timeout)), duration)
它不起作用,所以我再次添加id并ServerTimeout::T1调用了该timeout_ms方法:
id
ServerTimeout::T1
timeout_ms
event_loop.timeout_ms(ServerTimeout::T1(id, timeout), duration)