- int *ok = cls;
- struct GNUNET_MessageHeader msg;
- struct SignalTimeoutContext *stctx;
- GNUNET_SCHEDULER_TaskIdentifier ret;
-
- ret = GNUNET_SCHEDULER_NO_TASK;
- switch (*ok)
- {
- case 1:
- *ok = 2; /* report success */
- msg.type = htons (MY_TYPE2);
- msg.size = htons (sizeof (struct GNUNET_MessageHeader));
- receiver (receiver_cls, &msg, sizeof (struct GNUNET_MessageHeader), NULL, 0, 0);
- break;
- case 3:
- /* called after first receive instantly
- produced a reply;
- schedule receiver call with timeout
- after timeout expires! */
- *ok = 4;
- stctx = GNUNET_malloc (sizeof (struct SignalTimeoutContext));
- stctx->cb = receiver;
- stctx->cb_cls = receiver_cls;
- ret = GNUNET_SCHEDULER_add_delayed (sched,
- GNUNET_NO,
- GNUNET_SCHEDULER_PRIORITY_KEEP,
- GNUNET_SCHEDULER_NO_TASK,
- timeout, &signal_timeout, stctx);
- break;
- default:
- GNUNET_assert (0);
- }
- ti = ret;
+ GNUNET_assert (7 == ok);
+ ok = 0;
+ GNUNET_SERVER_destroy (server);
+ GNUNET_CLIENT_disconnect (cc);
+ GNUNET_CONFIGURATION_destroy (cfg);