Fixed silly bug with not giving proper warnings when already listening on a port

This commit is contained in:
M. Ian Graham 2008-04-02 20:13:42 +00:00
parent 42ac45fd53
commit 59c6d5137a

View File

@ -2,6 +2,7 @@ import direct
from pandac.PandaModules import HttpRequest
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.task.TaskManagerGlobal import taskMgr
from direct.task import Task
notify = directNotify.newCategory('WebRequestDispatcher')
@ -184,3 +185,17 @@ class WebRequestDispatcher(object):
uri = "/" + uri
self.uriToHandler.pop(uri,None)
# -- Poll task wrappers
def pollHTTPTask(self,task):
self.poll()
return Task.again
def startCheckingIncomingHTTP(self, interval=0.3):
taskMgr.remove('pollHTTPTask')
taskMgr.doMethodLater(interval,self.pollHTTPTask,'pollHTTPTask')
def stopCheckingIncomingHTTP(self):
taskMgr.remove('pollHTTPTask')