Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect client timeout ? #375

Closed
SteadEXE opened this issue Jun 11, 2015 · 11 comments
Closed

Detect client timeout ? #375

SteadEXE opened this issue Jun 11, 2015 · 11 comments

Comments

@SteadEXE
Copy link

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!

@dozmus
Copy link

dozmus commented Jul 1, 2015

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.

@SteadEXE
Copy link
Author

SteadEXE commented Jul 2, 2015

Thanks

2015-07-01 20:38 GMT+02:00 Pure_ notifications@github.com:

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
#375 (comment)
.

@philip-peterson
Copy link
Contributor

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: #214

@SteadEXE
Copy link
Author

SteadEXE commented Jul 4, 2015

I will try to patch and see if it works! Thanks for help bro

@SteadEXE
Copy link
Author

SteadEXE commented Jul 4, 2015

So many things had changed, it seems to be broken now :(

@SteadEXE
Copy link
Author

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 notifications@github.com:

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
#375 (comment)
.

@Booster2ooo
Copy link

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 ?

@SteadEXE
Copy link
Author

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 notifications@github.com:

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
#375 (comment)
.

@katanacrimson
Copy link
Contributor

Related to #76.

@ghost
Copy link

ghost commented Sep 11, 2015

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.

@jirwin
Copy link
Collaborator

jirwin commented Mar 24, 2016

This is fixed with #418 and #452.

@jirwin jirwin closed this as completed Mar 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants