summaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_bluetooth.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_bluetooth.c
parent5d8f6a7b2711cbabb7bd2d0104da03e2f67b4fd8 (diff)
Non-uniform keepalive timeout for different plugins
Diffstat (limited to 'src/transport/plugin_transport_bluetooth.c')
-rw-r--r--src/transport/plugin_transport_bluetooth.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/transport/plugin_transport_bluetooth.c b/src/transport/plugin_transport_bluetooth.c
index 87130feec..7fbdbcfa9 100644
--- a/src/transport/plugin_transport_bluetooth.c
+++ b/src/transport/plugin_transport_bluetooth.c
@@ -1120,6 +1120,21 @@ bluetooth_plugin_disconnect_session (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
+bluetooth_query_keepalive_factor (void *cls)
+{
+ return 3;
+}
+
+
+/**
* Function that can be used by the transport service to transmit
* a message using the plugin. Note that in the case of a
* peer disconnecting, the continuation MUST be called
@@ -1912,6 +1927,7 @@ libgnunet_plugin_transport_bluetooth_init (void *cls)
api->get_session = &bluetooth_plugin_get_session;
api->disconnect_peer = &bluetooth_plugin_disconnect_peer;
api->disconnect_session = &bluetooth_plugin_disconnect_session;
+ api->query_keepalive_factor = &bluetooth_query_keepalive_factor;
api->address_pretty_printer = &bluetooth_plugin_address_pretty_printer;
api->check_address = &bluetooth_plugin_address_suggested;
api->address_to_string = &bluetooth_plugin_address_to_string;;