From 8ca7cdcaa332b6ff53a5c67d3cd058011cc3614d Mon Sep 17 00:00:00 2001 From: Josh Wilson Date: Thu, 18 Jan 2007 22:18:04 +0000 Subject: [PATCH] reset _timeoutCount as well --- direct/src/distributed/AsyncRequest.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/direct/src/distributed/AsyncRequest.py b/direct/src/distributed/AsyncRequest.py index 8fe098a932..98ff58233d 100755 --- a/direct/src/distributed/AsyncRequest.py +++ b/direct/src/distributed/AsyncRequest.py @@ -105,11 +105,25 @@ class AsyncRequest(DirectObject): #DirectObject.DirectObject.delete(self) def startTimeOut(self, timeout = None): + """ + Start the request's timer. + timeout is the number of seconds to wait before triggering a response + + The kind of response depends what our limits are + before finally invoking the user defined timeout() + function and on how many times this request has timed + out before. + + This is called every time a this request restarts. For example, + if in finish() we have to send the request back again for more + data (as with ships), the time resets with each new task. + """ if timeout: self._timeoutTime = timeout self.cancelTimeOut() self.timeoutTask=taskMgr.doMethodLater( self._timeoutTime, self._timeout, "AsyncRequestTimer-%s"%(id(self,))) + self._timeoutCount = TimeoutFailureCount def cancelTimeOut(self): if self.timeoutTask: