- make reconnectInterval changeable (0: no automatic reconnection)

This commit is contained in:
zolliker
2013-06-25 11:21:04 +00:00
parent 8ecedfe443
commit 9a3607bd66
5 changed files with 76 additions and 10 deletions

View File

@ -773,7 +773,7 @@ AsconStatus AsconTask(Ascon * a)
lastClose = now;
a->fd = -1;
}
if (now > a->lastReconnect + a->reconnectInterval) {
if (a->reconnectInterval > 0 && now > a->lastReconnect + a->reconnectInterval) {
a->lastReconnect = now;
a->state = AsconConnectStart;
}
@ -840,3 +840,10 @@ double AsconGetSetTimeout(Ascon *a, double timeout, int setmode) {
}
return a->timeout;
}
int AsconReconnectInterval(Ascon *a, int interval) {
if (interval >= 0) {
a->reconnectInterval = interval;
}
return a->reconnectInterval;
}