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 timeout on ssl connections #121

Open
ernibert opened this issue Mar 9, 2024 · 1 comment
Open

ping timeout on ssl connections #121

ernibert opened this issue Mar 9, 2024 · 1 comment

Comments

@ernibert
Copy link

ernibert commented Mar 9, 2024

Hi,
I've implemented a client which connects via SSL to libera.cat (irc.libera.chat/6697).

It looks like the client has some issues with ping/pong as it constantly disconnects (server reports "qtirc hat die Verbindung getrennt (Ping timeout: 256 seconds)". It occurs 3 minutes after connecting, sometimes after 25 min even though i see that the client does emit debug output doing the PING-PONG dance. It looks like

[08:42] * qtirc ([email protected]) hat #channel betreten
[09:13] * qtirc hat die Verbindung getrennt (Ping timeout: 264 seconds)

This client does not use the buffer model, i maintain GUI elements by my own.

Interesting enough, i have tweaked the example client of the libcommuni package by adding

    connection->setSecure(true);
    connection->setPort(6697);

to void IrcClient::createConnection() and with that, the sample client does not show the ping-pong timeout (at least in a reasonable amount of time) show same behavior (first i thought it wouldn't, but it does).

My client connects also to a (local) irc server on 6667 (no SSL) and the ping-timeout issue does not occur on this connection. So i assume it has something to with SSL connections, but i have no idea how to proof that. On a connection via 6667/no-ssl to irc.libera.chat does not show any issues, too.

So, it looks like

  • SSL+BufferModel (example client) : Works Ping-timeouts
  • SSL+Self managed GUI: Ping-timeouts
  • NoSSL+BufferModel (example client) : Works
  • NoSSL+Self managed GUI: Works

I'm totally confused...

Please tell me which parts of the source I should provide in case you will want to help me but more details about the implementation is required.

Issue #85 sounds like addressing same problem but unfortunatly, no further discussion/details at that ticket.

@ernibert
Copy link
Author

It looks like this is not a client-side issue. I've experimented with this and that, set socket options (SO_KEEPALIVE) and such, nothing helped.

The big question was: Why does our client behaves this way while XChat/HexChat doesn't?
At the moment, it looks like that the answer is: Because they do conversation initiated by the client.

{X,Hex}chat do a /WHO command on a regular basis, i think for updating their internal user-db. I added a timer to my client which does a "/WHO *" every 2 minutes, too, and e voila, the client stays connected for 12h now. Previously, it got disconnected after a few minutes.

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

1 participant