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))); }
void CToxProto::DoTox() { { mir_cslock lock(toxLock); tox_iterate(tox); if (toxAv) toxav_do(toxAv); } uint32_t interval = tox_iteration_interval(tox); Sleep(interval); }