}
+/**
+ * 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!
return s;
}
+static void
+unix_plugin_update_session_timeout (void *cls,
+ const struct GNUNET_PeerIdentity *peer,
+ struct Session *session)
+{
+ struct Plugin *plugin = cls;
+
+ if (GNUNET_OK !=
+ GNUNET_CONTAINER_multipeermap_contains_value (plugin->session_map,
+ &session->target,
+ session))
+ return;
+
+ reschedule_session_timeout (session);
+}
/**
* Function that can be used by the transport service to transmit
memcpy (&message->sender, plugin->env->my_identity,
sizeof (struct GNUNET_PeerIdentity));
memcpy (&message[1], msgbuf, msgbuf_size);
- reschedule_session_timeout (session);
+
wrapper = GNUNET_new (struct UNIXMessageWrapper);
wrapper->msg = message;
wrapper->msgsize = ssize;
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;
api->string_to_address = &unix_string_to_address;
api->get_network = &unix_get_network;
+ api->update_session_timeout = &unix_plugin_update_session_timeout;
sockets_created = unix_transport_server_start (plugin);
if (0 == sockets_created)
LOG (GNUNET_ERROR_TYPE_WARNING,