From 4e67f0c94b70b5c84502080485fee34d546a76cf Mon Sep 17 00:00:00 2001 From: LRN Date: Sun, 15 Dec 2013 01:56:00 +0000 Subject: Non-uniform keepalive timeout for different plugins --- src/transport/plugin_transport_bluetooth.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/transport/plugin_transport_bluetooth.c') 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 @@ -1119,6 +1119,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 @@ -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;; -- cgit v1.2.3