From 59c6d5137a74f05853e67187fc0d6ddc75272476 Mon Sep 17 00:00:00 2001 From: "M. Ian Graham" Date: Wed, 2 Apr 2008 20:13:42 +0000 Subject: [PATCH] Fixed silly bug with not giving proper warnings when already listening on a port --- direct/src/http/WebRequest.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/direct/src/http/WebRequest.py b/direct/src/http/WebRequest.py index 45f3d42f94..efadef6523 100755 --- a/direct/src/http/WebRequest.py +++ b/direct/src/http/WebRequest.py @@ -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') +