summaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_unix.c
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2013-12-15 01:56:00 +0000
committerLRN <lrn1986@gmail.com>2013-12-15 01:56:00 +0000
commit4e67f0c94b70b5c84502080485fee34d546a76cf (patch)
tree98e9aa18e390910831e8212c2bccc3641b02f23e /src/transport/plugin_transport_unix.c
parent5d8f6a7b2711cbabb7bd2d0104da03e2f67b4fd8 (diff)
Non-uniform keepalive timeout for different plugins
Diffstat (limited to 'src/transport/plugin_transport_unix.c')
-rw-r--r--src/transport/plugin_transport_unix.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index 3d6ac4d23..906cf9997 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -600,6 +600,21 @@ unix_session_disconnect (void *cls,
/**
+ * Function that is called to get the keepalive factor.
+ * GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT is divided by this number to
+ * calculate the interval between keepalive packets.
+ *
+ * @param cls closure with the `struct Plugin`
+ * @return keepalive factor
+ */
+static unsigned int
+unix_query_keepalive_factor (void *cls)
+{
+ return 3;
+}
+
+
+/**
* Actually send out the message, assume we've got the address and
* send_handle squared away!
*
@@ -1614,6 +1629,7 @@ libgnunet_plugin_transport_unix_init (void *cls)
api->send = &unix_plugin_send;
api->disconnect_peer = &unix_peer_disconnect;
api->disconnect_session = &unix_session_disconnect;
+ api->query_keepalive_factor = &unix_query_keepalive_factor;
api->address_pretty_printer = &unix_plugin_address_pretty_printer;
api->address_to_string = &unix_address_to_string;
api->check_address = &unix_check_address;