stupid parentheses, but happier Region.connect()

This commit is contained in:
enus.linden
2009-01-06 06:33:09 +00:00
committed by Salad Dais
parent f8fcb086c9
commit 54d8b8a30c

View File

@@ -172,42 +172,22 @@ class Region(object):
self.messenger.send_message(msg, self.host)
#self.udpconnection = UDPConnection(self.details, self.messenger, self.host)
#api.spawn(self.udp_listener)
#api.sleep()
#while self.udpconnection._mailbox:
#api.sleep()
#self.udp_listener()
udpProcess = UDPConnection(self.details, self.messenger, self.host)
#UDPConnection(self.details, self.messenger, self.host).start()
#print 'Here I am'
#class UDPConnection(threading.Thread):
class UDPConnection(object):
def __init__(self, details, messenger, host):
#print "Entering loop"
self.last_ping = 0
self.start = time.time()
self.now = self.start
self.packets = {}
self.host = host
self.messenger = messenger
self.details = details
log(DEBUG, 'Spawning region UDP connection')
#coros.Actor.__init__(self)
api.spawn(self._connect(), 1)
#threading.Thread.__init__(self)
api.spawn(self._processUDP)
def _connect(self):
#def run(self):
#ToDo: lots to do. work with the eventqueue via eventlet coros, object model clieanup, all that jazz
def _processUDP(self):
while True:
# free up resources for other stuff to happen
api.sleep(0)
msg_buf, msg_size = self.messenger.udp_client.receive_packet(self.messenger.socket)
packet = self.messenger.receive_check(self.messenger.udp_client.get_sender(),
@@ -263,10 +243,8 @@ class UDPConnection(object):
Flags=0x00))
self.messenger.send_message(msg, self.host)
if self.now - self.start > 30: break
api.sleep(0.5)
def _processEventQueue(self):
class RegionSeedCapability(Capability):