[sldev-commits] r1063 - projects/2008/pyogp/pyogp.lib.base/branches/locklainn-message-refactoring/pyogp/lib/base/message

locklainn.linden at svn.secondlife.com locklainn.linden at svn.secondlife.com
Fri Aug 22 07:57:24 PDT 2008


Author: locklainn.linden
Date: 2008-08-22 09:57:23 -0500 (Fri, 22 Aug 2008)
New Revision: 1063

Modified:
   projects/2008/pyogp/pyogp.lib.base/branches/locklainn-message-refactoring/pyogp/lib/base/message/packet.py
   projects/2008/pyogp/pyogp.lib.base/branches/locklainn-message-refactoring/pyogp/lib/base/message/udpdispatcher.py
Trac: http://svn.secondlife.com/trac/linden/changeset/1063
Log:
THIS is the better split

Modified: projects/2008/pyogp/pyogp.lib.base/branches/locklainn-message-refactoring/pyogp/lib/base/message/packet.py
===================================================================
--- projects/2008/pyogp/pyogp.lib.base/branches/locklainn-message-refactoring/pyogp/lib/base/message/packet.py	2008-08-22 13:44:52 UTC (rev 1062)
+++ projects/2008/pyogp/pyogp.lib.base/branches/locklainn-message-refactoring/pyogp/lib/base/message/packet.py	2008-08-22 14:57:23 UTC (rev 1063)
@@ -10,7 +10,6 @@
     def __init__(self, context):
         self.name = context.name
         self.send_flags         = PackFlags.LL_NONE
-        self.reliable_params    = {}
         self.packet_id          = 0 #aka, sequence number
 
         self.message_data       = context

Modified: projects/2008/pyogp/pyogp.lib.base/branches/locklainn-message-refactoring/pyogp/lib/base/message/udpdispatcher.py
===================================================================
--- projects/2008/pyogp/pyogp.lib.base/branches/locklainn-message-refactoring/pyogp/lib/base/message/udpdispatcher.py	2008-08-22 13:44:52 UTC (rev 1062)
+++ projects/2008/pyogp/pyogp.lib.base/branches/locklainn-message-refactoring/pyogp/lib/base/message/udpdispatcher.py	2008-08-22 14:57:23 UTC (rev 1063)
@@ -19,7 +19,6 @@
     def __init__(self):
         #holds the details of the message, or how the messages should be sent,
         #built, and read
-        self.reliable_msg       = False
         self.circuit_manager    = CircuitManager()
         #the ID of the packet we most recently received
         self.receive_packet_id  = -1
@@ -73,12 +72,9 @@
         """ Wants to be acked """
         #sets up the message so send_message will add the RELIABLE flag to
         #the message
-        self.reliable_msg = True
         packet.send_flags |= PackFlags.LL_RELIABLE_FLAG
-        packet.reliable_params = {}
         packet.retries = retries
-        packet.reliable_params['host'] = host
-        return self.send_message(packet, host)
+        return self.send_message(packet, host, reliable=True)
     
     def send_retry(self, packet, host):
         """ This is a retry because we didn't get acked """
@@ -86,7 +82,7 @@
         packet.send_flags |= PackFlags.LL_RESENT_FLAG
         return self.send_message(host, packet)                
 
-    def send_message(self, packet, host):
+    def send_message(self, packet, host, reliable=False):
         """ Sends the message that is currently built to the desired host """
         message_size = -1
         
@@ -113,7 +109,7 @@
         serializer = ISerialization(packet)
         send_buffer = serializer.serialize()
 
-        if self.reliable_msg == True:
+        if reliable == True:
             if circuit.unack_packet_count <= 0:
                 self.circuit_manager.unacked_circuits[host] = circuit
 
@@ -121,7 +117,6 @@
 
         #TODO: remove this when testing a network
         self.udp_client.send_packet(self.socket, send_buffer, host)
-        self.reliable_msg = False
 
         return send_buffer
                         



More information about the sldev-commits mailing list