reset _timeoutCount as well

This commit is contained in:
Josh Wilson 2007-01-18 22:18:04 +00:00
parent 3f498d6ee8
commit 8ca7cdcaa3
1 changed files with 14 additions and 0 deletions

View File

@ -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: