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

Ping/Pong behaviour #44

Closed
mweinelt opened this issue Mar 15, 2019 · 1 comment
Closed

Ping/Pong behaviour #44

mweinelt opened this issue Mar 15, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@mweinelt
Copy link
Contributor

Usually its the server that pings the client, and as long as the client answers with a pong everything is fine.

Now when the server goes away CptHook does not seem to take notice. CptHook needs to regularly check whether ping/pongs are happening to detect connection issues. If the server doesn't send any, send them yourself. If that fails multiple times it's time to reconnect.

@fleaz fleaz added the enhancement New feature or request label Mar 27, 2019
@fleaz
Copy link
Owner

fleaz commented Apr 23, 2019

I checked the girc documentation and verified with debug logging: A PING is send every 20 seconds and after 3 unanswered requests the client turns into disconnected state and attempts a reconnect. This can be seen in the following log where I dropped my default route to simulate network outage:

debug:01:05:14 conn.go:457: > PING 1556060714342450219
debug:01:05:34 conn.go:457: > PING 1556060734342429672
debug:01:05:54 conn.go:558: closing pingLoop
debug:01:05:54 conn.go:319: received error, beginning clean up
debug:01:05:54 conn.go:491: closing sendLoop
debug:01:05:54 client.go:316: received signal to close, flushing 0 events and executing
debug:01:05:54 client.go:328: closing execLoop
debug:01:05:54 conn.go:371: closing readLoop
debug:01:05:54 conn.go:335: waiting for all routines to finish
WARN[0080] Connection to irc.hackint.eu:6697 terminated: timed out waiting for a requested PING response 
WARN[0080] Reconnecting in 30 seconds...

@fleaz fleaz closed this as completed Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants