Exemplo n.º 1
0
void* sender_new(void* address)
{
    sender_t* me;

    me = malloc(sizeof(sender_t));
    me->outbox = llqueue_new();
    me->inbox = llqueue_new();
    __senders = realloc(__senders,sizeof(sender_t*) * (++__nsenders));
    __senders[__nsenders-1] = me;
    return me;
}
Exemplo n.º 2
0
//ev init
void mqtt_client_init(EV_ALL *cev, char *host, int port)
{
	int rc;
	if(cev->client.send_queue)
		llqueue_free(cev->client.send_queue);
	cev->client.send_queue = llqueue_new();
	rc = ConnectNetwork(cev->client.ipstack, host, port);
//	if(rc <0)
//	{
//		printf("ConnectNetwork failed\n");
//		MQTTReConnect(&cev->client);
//	}
	snprintf(cev->client.mqtt_server, SERVER_MAX_LEN-1, "%s", host);
	cev->client.mqtt_port = port;
	mqtt_client_initw(cev);  //watchers init
}
Exemplo n.º 3
0
void zigbee_init()
{
	global_ev_all.zigbee_client.send_queue = llqueue_new();
	global_ev_all.zigbee_client.keepAliveInterval = ZIGBEE_KEEPALIVE;
	zigbee_client_init(&global_ev_all, ZIGBEE_SERVER, ZIGBEE_PORT);
}