Detect client timeout ?
Hello,
I am sorry to open a new issue but I looked at all issues about detecting when the client timeout but I didn't found a working solution, or something understandable. In every issues I saw they were all doing a redirection loop a mention loop.
So can someone help me found a solution please ? I have see the idea of send PING request, but who should ping who ?
Thanks for helping and have a nice day!
You can send a ping message to the server and then await a response (pong). You will be sending the ping to the IRC server you are connected to. If the response if not received within a given amount of time you can assume your client to be disconected.
Thanks
2015-07-01 20:38 GMT+02:00 Pure_ [email protected]:
You can send a ping message https://tools.ietf.org/html/rfc2812#section-3.7.2 to the server and then await a response (pong). You will be sending the ping to the IRC server you are connected to. If the response if not received within a given amount of time you can assume your client to be disconected.
— Reply to this email directly or view it on GitHub https://github.com/martynsmith/node-irc/issues/375#issuecomment-117791303 .
There is a patch I submitted a while ago to add ping timeouts, but it was during the attempted restructuring and probably got lost among the chaos. Here's a link: https://github.com/martynsmith/node-irc/pull/214
I will try to patch and see if it works! Thanks for help bro
So many things had changed, it seems to be broken now :(
I bind a PING event, but the bot still not detecting it. Did you put autoreconnect: true ? or something like this somewhere ?
Thanks for help
2015-07-28 17:38 GMT+02:00 Booster2ooo [email protected]:
I had the same trouble, I tried to attach a PING and a RAW event in order to test/debug the issue and it seems that attaching a PING event to the client solve the problem... give it a try?
— Reply to this email directly or view it on GitHub https://github.com/martynsmith/node-irc/issues/375#issuecomment-125656904 .
Sorry, I removed my reply because it was irrelevant. In my code, I used autoconnect true. Did you try to listen to the 'close' event ? If it doesn't solve the problem, you might try to send() a ping at regular interval... maybe ?
I fixed the problem, everytime I receive à PING from the server, it start a timer for 5 minutes, if it receive an another PING it reset the timer, so if the timer trigger it attempt to reconnect and reset the timer. So the bot will auto reconnect but manually.
2015-07-30 9:02 GMT+02:00 Booster2ooo [email protected]:
Sorry, I removed my reply because it was irrelevant. In my code, I used autoconnect true. Did you try to listen to the 'close' event ? If it doesn't solve the problem, you might try to send() a ping at regular interval... maybe ?
— Reply to this email directly or view it on GitHub https://github.com/martynsmith/node-irc/issues/375#issuecomment-126205473 .
Related to #76.
The pull request was reopened, i believe a merge is possible.
@philip-peterson i hope it would be pretty simple to re-merge this since you already spent time on it before, not sure if thats possible though.
This is fixed with #418 and #452.