*/
const struct GNUNET_CONFIGURATION_Handle *cfg;
- /**
- * Handle to talk with CONVERSATION service.
- */
- struct GNUNET_CLIENT_Connection *client;
-
/**
* We keep all callers in a DLL.
*/
GNUNET_MQ_destroy (phone->mq);
phone->mq = NULL;
}
- if (NULL != phone->client)
- {
- GNUNET_CLIENT_disconnect (phone->client);
- phone->client = NULL;
- }
phone->state = PS_REGISTER;
- phone->client = GNUNET_CLIENT_connect ("conversation", phone->cfg);
- if (NULL == phone->client)
+ phone->mq = GNUNET_CLIENT_connecT (phone->cfg,
+ "conversation",
+ handlers,
+ &phone_error_handler,
+ phone);
+ if (NULL == phone->mq)
return;
- phone->mq = GNUNET_MQ_queue_for_connection_client (phone->client,
- handlers,
- &phone_error_handler,
- phone);
e = GNUNET_MQ_msg (reg, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER);
reg->line = phone->my_record.line;
GNUNET_MQ_send (phone->mq, e);
phone->my_record.line = htonl ((uint32_t) line);
phone->my_record.version = htonl (0);
reconnect_phone (phone);
- if ( (NULL == phone->client) ||
+ if ( (NULL == phone->mq) ||
(NULL == phone->ns) )
{
GNUNET_break (0);
GNUNET_MQ_destroy (phone->mq);
phone->mq = NULL;
}
- if (NULL != phone->client)
- {
- GNUNET_CLIENT_disconnect (phone->client);
- phone->client = NULL;
- }
GNUNET_free (phone);
}