alexyoung / ircd.js

A Node ircd (IRC daemon)
GNU General Public License v3.0
528 stars 90 forks source link

Update user.js #73

Closed slifin closed 10 years ago

slifin commented 10 years ago

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

laurengarcia commented 10 years ago

+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!