I was debugging why some of my clients were timing out when using KiwiIRC (although not on some other clients), it seems:
user.hasTimedOut
and
server.startTimeoutHandler
both use config.pingTimeout which in my config file were 120
what startTimeoutHandler will do is send a PING request to the client every 120 seconds to check if the client is alive and then update the lastping date, and hasTimedOut will consider a client as timed out after 120 seconds, that seems to give little to no wiggle room for the client to respond to ping / pong if those checks happen around the same time, I've added a rounding down to help widen the gap
+1 Can confirm that I was seeing the same issue using web-based NIRC client via socket.io (https://github.com/cjstewart88/nirc). Your fix resolved it for me locally. Thanks!
I was debugging why some of my clients were timing out when using KiwiIRC (although not on some other clients), it seems: user.hasTimedOut and server.startTimeoutHandler both use config.pingTimeout which in my config file were 120
what startTimeoutHandler will do is send a PING request to the client every 120 seconds to check if the client is alive and then update the lastping date, and hasTimedOut will consider a client as timed out after 120 seconds, that seems to give little to no wiggle room for the client to respond to ping / pong if those checks happen around the same time, I've added a rounding down to help widen the gap