Allenxuxu / gev

🚀Gev is a lightweight, fast non-blocking TCP network library / websocket server based on Reactor mode. Support custom protocols to quickly and easily build high-performance servers.
MIT License
1.72k stars 193 forks source link

feature: 是否可以加入读写超时的配置 #53

Closed rfyiamcool closed 3 years ago

rfyiamcool commented 3 years ago

我现在基于gev基础上抽象了connection结构,基于定时器加回调conn.Close()实现的读超时。建立连接后,加入一个读超时时间,如果无法在一个时间窗口内收到请求,则关闭连接。

timer.AferRun(conn.Close())

是否可以在gev内部加入该功能?

Allenxuxu commented 3 years ago

请问你的应用场景是什么? 目前,gev 是有主动剔除空闲连接的功能的,能满足需求吗?

rfyiamcool commented 3 years ago

这个可以满足,谢谢。