Ejemplo n.º 1
0
void Core::process()
{
    if (!isReady())
        return;

    static int tolerance = CORE_DISCONNECT_TOLERANCE;
    tox_iterate(tox);
    toxav_do(toxav);

#ifdef DEBUG
    //we want to see the debug messages immediately
    fflush(stdout);
#endif

    if (checkConnection())
    {
        tolerance = CORE_DISCONNECT_TOLERANCE;
    }
    else if (!(--tolerance))
    {
        bootstrapDht();
        tolerance = 3*CORE_DISCONNECT_TOLERANCE;
    }

    toxTimer->start(qMin(tox_iteration_interval(tox), toxav_do_interval(toxav)));
}
Ejemplo n.º 2
0
void CToxProto::DoTox()
{
	{
		mir_cslock lock(toxLock);
		tox_iterate(tox);
		if (toxAv)
			toxav_do(toxAv);
	}
	uint32_t interval = tox_iteration_interval(tox);
	Sleep(interval);
}