mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
removing directd.py, use directd.cxx, etc. instead
This commit is contained in:
parent
15477e84b7
commit
709572a66e
@ -1,50 +0,0 @@
|
||||
#!python
|
||||
"""directd stuff"""
|
||||
|
||||
from AIBaseGlobal import *
|
||||
import DirectNotifyGlobal
|
||||
import Datagram
|
||||
import DatagramIterator
|
||||
|
||||
|
||||
print "hello"
|
||||
|
||||
|
||||
class DirectD:
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory("DirectD")
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def connect(self, ip, port, timeout=5000):
|
||||
self.qcm=QueuedConnectionManager()
|
||||
self.tcpConn=self.qcm.openTCPClientConnection(ip, port, timeout)
|
||||
|
||||
if self.tcpConn == None:
|
||||
# Bad Connection
|
||||
print "noConnection"
|
||||
else:
|
||||
# Good Connection
|
||||
# Set up connection reader and writer
|
||||
self.qcr=QueuedConnectionReader(self.qcm, 0)
|
||||
self.qcr.addConnection(self.tcpConn)
|
||||
self.cw=ConnectionWriter(self.qcm, 0)
|
||||
while 0:
|
||||
s=raw_input("send: ")
|
||||
d=Datagram.Datagram()
|
||||
d.addString(s)
|
||||
self.cw.send(d, self.tcpConn)
|
||||
while self.qcr.dataAvailable():
|
||||
nd=NetDatagram()
|
||||
self.qcr.getData(nd)
|
||||
print "address", nd.getAddress().getIp()
|
||||
nd.dumpHex(ostream)
|
||||
#self.startReaderPollTask()
|
||||
|
||||
# Register our channel
|
||||
#self.registerForChannel(self.ourChannel)
|
||||
|
||||
def foo():
|
||||
dd = DirectD()
|
||||
dd.connect("127.0.0.1", 8001)
|
||||
dd.connect("127.0.0.1", 8002)
|
Loading…
x
Reference in New Issue
Block a user