diff options
author | LRN <lrn1986@gmail.com> | 2013-12-15 01:56:00 +0000 |
---|---|---|
committer | LRN <lrn1986@gmail.com> | 2013-12-15 01:56:00 +0000 |
commit | 4e67f0c94b70b5c84502080485fee34d546a76cf (patch) | |
tree | 98e9aa18e390910831e8212c2bccc3641b02f23e /src/transport/plugin_transport_bluetooth.c | |
parent | 5d8f6a7b2711cbabb7bd2d0104da03e2f67b4fd8 (diff) | |
download | gnunet-4e67f0c94b70b5c84502080485fee34d546a76cf.tar.gz gnunet-4e67f0c94b70b5c84502080485fee34d546a76cf.zip |
Non-uniform keepalive timeout for different plugins
Diffstat (limited to 'src/transport/plugin_transport_bluetooth.c')
-rw-r--r-- | src/transport/plugin_transport_bluetooth.c | 16 |
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, | |||
1120 | 1120 | ||
1121 | 1121 | ||
1122 | /** | 1122 | /** |
1123 | * Function that is called to get the keepalive factor. | ||
1124 | * GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT is divided by this number to | ||
1125 | * calculate the interval between keepalive packets. | ||
1126 | * | ||
1127 | * @param cls closure with the `struct Plugin` | ||
1128 | * @return keepalive factor | ||
1129 | */ | ||
1130 | static unsigned int | ||
1131 | bluetooth_query_keepalive_factor (void *cls) | ||
1132 | { | ||
1133 | return 3; | ||
1134 | } | ||
1135 | |||
1136 | |||
1137 | /** | ||
1123 | * Function that can be used by the transport service to transmit | 1138 | * Function that can be used by the transport service to transmit |
1124 | * a message using the plugin. Note that in the case of a | 1139 | * a message using the plugin. Note that in the case of a |
1125 | * peer disconnecting, the continuation MUST be called | 1140 | * peer disconnecting, the continuation MUST be called |
@@ -1912,6 +1927,7 @@ libgnunet_plugin_transport_bluetooth_init (void *cls) | |||
1912 | api->get_session = &bluetooth_plugin_get_session; | 1927 | api->get_session = &bluetooth_plugin_get_session; |
1913 | api->disconnect_peer = &bluetooth_plugin_disconnect_peer; | 1928 | api->disconnect_peer = &bluetooth_plugin_disconnect_peer; |
1914 | api->disconnect_session = &bluetooth_plugin_disconnect_session; | 1929 | api->disconnect_session = &bluetooth_plugin_disconnect_session; |
1930 | api->query_keepalive_factor = &bluetooth_query_keepalive_factor; | ||
1915 | api->address_pretty_printer = &bluetooth_plugin_address_pretty_printer; | 1931 | api->address_pretty_printer = &bluetooth_plugin_address_pretty_printer; |
1916 | api->check_address = &bluetooth_plugin_address_suggested; | 1932 | api->check_address = &bluetooth_plugin_address_suggested; |
1917 | api->address_to_string = &bluetooth_plugin_address_to_string;; | 1933 | api->address_to_string = &bluetooth_plugin_address_to_string;; |