mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
*** empty log message ***
This commit is contained in:
parent
8c22cad702
commit
8def769881
@ -64,7 +64,49 @@ class ClientRepository(DirectObject.DirectObject):
|
||||
self.startReaderPollTask()
|
||||
return self.tcpConn
|
||||
|
||||
def startRawReaderPollTask(self):
|
||||
# Stop any tasks we are running now
|
||||
self.stopRawReaderPollTask()
|
||||
self.stopReaderPollTask()
|
||||
task = Task.Task(self.rawReaderPollUntilEmpty)
|
||||
# Start with empty string
|
||||
task.currentRawString = ""
|
||||
taskMgr.spawnTaskNamed(task, "rawReaderPollTask")
|
||||
return None
|
||||
|
||||
def stopRawReaderPollTask(self):
|
||||
taskMgr.removeTasksNamed("rawReaderPollTask")
|
||||
return None
|
||||
|
||||
def rawReaderPollUntilEmpty(self, task):
|
||||
while self.rawReaderPollOnce():
|
||||
pass
|
||||
return Task.cont
|
||||
|
||||
def rawReaderPollOnce(self):
|
||||
self.notify.debug("rawReaderPollOnce")
|
||||
self.ensureValidConnection()
|
||||
availGetVal = self.qcr.dataAvailable()
|
||||
if availGetVal:
|
||||
datagram = NetDatagram()
|
||||
readRetVal = self.qcr.getData(datagram)
|
||||
if readRetVal:
|
||||
str = datagram.getMessage()
|
||||
self.notify.debug("rawReaderPollOnce: found str: " + str)
|
||||
self.handleRawString(str)
|
||||
else:
|
||||
ClientRepository.notify.warning("getData returned false")
|
||||
return availGetVal
|
||||
|
||||
def handleRawString(self, str):
|
||||
# This method is meant to be pure virtual, and any classes that
|
||||
# inherit from it need to make their own handleRawString method
|
||||
pass
|
||||
|
||||
def startReaderPollTask(self):
|
||||
# Stop any tasks we are running now
|
||||
self.stopRawReaderPollTask()
|
||||
self.stopReaderPollTask()
|
||||
task = Task.Task(self.readerPollUntilEmpty)
|
||||
taskMgr.spawnTaskNamed(task, "readerPollTask")
|
||||
return None
|
||||
|
@ -244,6 +244,8 @@ class ShowBase:
|
||||
# temporary try..except for old pandas.
|
||||
try:
|
||||
self.win.closeWindow()
|
||||
del self.win
|
||||
del self.pipe
|
||||
except:
|
||||
pass
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user