use separate function for delayed start now that CommandTimeout has been changed to include retries and other stuff.

r1972 | dcl | 2007-05-21 17:51:50 +1000 (Mon, 21 May 2007) | 2 lines
This commit is contained in:
Douglas Clowes
2007-05-21 17:51:50 +10:00
parent 65b36cf992
commit 4e5ea6a61c

View File

@@ -132,6 +132,7 @@ static int AQ_Reconnect(pAsyncQueue self)
static int CommandTimeout(void* cntx, int mode);
static int DelayedStart(void* cntx, int mode);
static int StartCommand(pAsyncQueue self)
{
@@ -167,7 +168,7 @@ static int StartCommand(pAsyncQueue self)
delay *= 1000;
delay += (when.tv_usec - now.tv_usec + (1000 - 1)) / 1000;
NetWatchRegisterTimer(&self->nw_tmr, delay,
CommandTimeout, self);
DelayedStart, self);
return OKOK;
}
}
@@ -288,6 +289,14 @@ static int CommandTimeout(void* cntx, int mode)
return 1;
}
static int DelayedStart(void* cntx, int mode)
{
pAsyncQueue self = (pAsyncQueue) cntx;
self->nw_tmr = 0;
StartCommand(self);
return 1;
}
static int MyCallback(void* context, int mode)
{
pAsyncQueue self = (pAsyncQueue) context;