mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Merge pull request #594 from FullName/nTox.KeepBootstrappingUntilConnected
nTox: keep bootstrap()ping every 10 seconds, until we get a connection...
This commit is contained in:
commit
892c7aa266
|
@ -667,10 +667,19 @@ int main(int argc, char *argv[])
|
||||||
new_lines(whoami);
|
new_lines(whoami);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time_t timestamp0 = time(NULL);
|
||||||
while (1) {
|
while (1) {
|
||||||
if (on == 0 && tox_isconnected(m)) {
|
if (on == 0) {
|
||||||
new_lines("[i] connected to DHT");
|
if (tox_isconnected(m)) {
|
||||||
on = 1;
|
new_lines("[i] connected to DHT");
|
||||||
|
on = 1;
|
||||||
|
} else {
|
||||||
|
time_t timestamp1 = time(NULL);
|
||||||
|
if (timestamp0 + 10 < timestamp1) {
|
||||||
|
timestamp0 = timestamp1;
|
||||||
|
tox_bootstrap_from_address(m, argv[argvoffset + 1], ipv6enabled, port, binary_string);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tox_do(m);
|
tox_do(m);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user