A lot of nats drop idle tcp connections after an hour or so, current idle does't detect this. Only when a message is sent it suddenly realizes what happened. Which is bad A common solution is to send keep-alive packets once in a while (PING or other) if there is no other traffic.
Created attachment 45016 [details] [review] Send keep alive packets XChat-GNOME tries to obfuscate the timestamp a bit: GTimeVal timev; g_get_current_time (&timev); return (timev.tv_sec - 50000) * 1000000 + timev.tv_usec; This is probably a lame attempt at maintaining the privacy of the user by hiding the actual time at his end.
Created attachment 45702 [details] [review] Send keep alive packets The interval is now configurable. A new parameter keepalive-interval similar to the one in Gabble has been added.
Created attachment 45704 [details] [review] Send keep alive packets Updated data/idle.manager.
Review of attachment 45704 [details] [review]: ::: src/idle-connection.c @@ +24,3 @@ #include <config.h> +#include <inttypes.h> Unneeded, see below. @@ +753,3 @@ } +static void _send_with_priority(IdleConnection *conn, const gchar *msg, guint priority); I don't think this should be in the middle of the file. Put it at the top. @@ +767,3 @@ + + ping_time = g_get_real_time(); + gint64 ping_time; Use G_GINT64_FORMAT instead of PRId64
Created attachment 45842 [details] [review] Send keep alive packets Fixed as suggested in the review.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.