Bug 35058 - Should send keep-alive packets to detect dropped connections.
Summary: Should send keep-alive packets to detect dropped connections.
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: idle (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-06 04:04 UTC by Sjoerd Simons
Modified: 2011-04-20 00:46 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Send keep alive packets (3.16 KB, patch)
2011-03-29 17:03 UTC, Debarshi Ray
Details | Splinter Review
Send keep alive packets (7.10 KB, patch)
2011-04-16 03:11 UTC, Debarshi Ray
Details | Splinter Review
Send keep alive packets (7.59 KB, patch)
2011-04-16 03:37 UTC, Debarshi Ray
Details | Splinter Review
Send keep alive packets (7.92 KB, patch)
2011-04-19 23:35 UTC, Debarshi Ray
Details | Splinter Review

Description Sjoerd Simons 2011-03-06 04:04:50 UTC
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.
Comment 1 Debarshi Ray 2011-03-29 17:03:45 UTC
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.
Comment 2 Debarshi Ray 2011-04-16 03:11:36 UTC
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.
Comment 3 Debarshi Ray 2011-04-16 03:37:37 UTC
Created attachment 45704 [details] [review]
Send keep alive packets

Updated data/idle.manager.
Comment 4 Danielle Madeley 2011-04-18 18:10:15 UTC
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
Comment 5 Debarshi Ray 2011-04-19 23:35:35 UTC
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.