static void task (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) { cfg = c; arm = GNUNET_ARM_connect (cfg, NULL, NULL); if (NULL == arm) { GNUNET_break (0); return; } mon = GNUNET_ARM_monitor_start (cfg, &srv_status, NULL); if (NULL == mon) { GNUNET_break (0); GNUNET_ARM_disconnect (arm); arm = NULL; return; } GNUNET_ARM_request_service_start (arm, "arm", GNUNET_OS_INHERIT_STD_OUT_AND_ERR, &arm_start_cb, NULL); GNUNET_SCHEDULER_add_shutdown (&trigger_disconnect, NULL); }
static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) { arm = GNUNET_ARM_connect (c, NULL, NULL); GNUNET_ARM_request_service_start (arm, "arm", GNUNET_OS_INHERIT_STD_OUT_AND_ERR, START_TIMEOUT, &arm_start_cb, NULL); }
static void task (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) { cfg = c; arm = GNUNET_ARM_connect (cfg, NULL); #if START_ARM GNUNET_ARM_start_service (arm, "arm", GNUNET_OS_INHERIT_STD_OUT_AND_ERR, GNUNET_TIME_UNIT_ZERO, &arm_notify, NULL); #else arm_do_nothing (NULL, GNUNET_YES); #endif }
* a service. * * @param cls closure * @param cfg configuration of the peer to connect to; will be available until * GNUNET_TESTBED_operation_done() is called on the operation returned * from GNUNET_TESTBED_service_connect() * @return service handle to return in 'op_result', NULL on error */ static void * arm_connect_adapter (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) { FAIL_TEST (NULL == cls, return NULL); FAIL_TEST (OTHER == sub_test, return NULL); sub_test = PEER_SERVICE_CONNECT; arm_handle = GNUNET_ARM_connect (cfg, NULL, NULL); return arm_handle; } /** * Adapter function called to destroy a connection to * a service. * * @param cls closure * @param op_result service handle returned from the connect adapter */ static void arm_disconnect_adapter (void *cls, void *op_result) {