static void
disconnected (void *cls)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnected()\n");
GNUNET_SCHEDULER_shutdown ();
}
static void
app_disconnected (void *cls)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "app_disconnected()\n");
if (hst || gst)
{
if (hst)
static void
disconnect ()
{
- GNUNET_CORE_disconnect (core);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnect()\n");
GNUNET_SOCIAL_app_disconnect (app, app_disconnected, NULL);
}
+
/**
* Callback called when the program failed to finish the requested operation in time.
*/
static void
timeout (void *cls)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Timeout.\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "timeout()\n");
disconnect ();
}
* Establish application connection to receive available egos and places.
*/
static void
-app_connect ()
+app_connect (void *cls)
{
+ GNUNET_CORE_disconnect (core);
+ core = NULL;
+
app = GNUNET_SOCIAL_app_connect (cfg, opt_app,
app_recv_ego,
app_recv_host,
core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity)
{
this_peer = *my_identity;
- app_connect ();
+ GNUNET_SCHEDULER_add_now (app_connect, NULL);
}
run (void *cls, char *const *args, const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *c)
{
- GNUNET_SIGNAL_handler_install (SIGINT, disconnect);
- GNUNET_SIGNAL_handler_install (SIGTERM, disconnect);
- GNUNET_SIGNAL_handler_install (SIGKILL, disconnect);
+// GNUNET_SIGNAL_handler_install (SIGINT, disconnect);
+// GNUNET_SIGNAL_handler_install (SIGTERM, disconnect);
+// GNUNET_SIGNAL_handler_install (SIGKILL, disconnect);
cfg = c;