[stacklessexamples] r174 committed - Fix tuple ordering in the write queue to match the positioning of the ...

2 views
Skip to first unread message

stackles...@googlecode.com

unread,
Jan 11, 2011, 7:12:20 PM1/11/11
to stackless-exa...@googlegroups.com
Revision: 174
Author: richar...@gmail.com
Date: Tue Jan 11 16:11:31 2011
Log: Fix tuple ordering in the write queue to match the positioning of the
channel in the read queue. This is required because they share the same
queue clearing logic that awakens tasklets blocked in channels on the
queues, when the socket is closed.
http://code.google.com/p/stacklessexamples/source/detail?r=174

Modified:
/trunk/examples/networking/stacklesssocket.py

=======================================
--- /trunk/examples/networking/stacklesssocket.py Thu Jan 6 20:10:50 2011
+++ /trunk/examples/networking/stacklesssocket.py Tue Jan 11 16:11:31 2011
@@ -385,7 +385,7 @@

channel = stackless.channel()
channel.preference = 1 # Prefer the sender.
- self.writeQueue.append((flags, data, channel))
+ self.writeQueue.append((channel, flags, data))
return self.receive_with_timeout(channel)

def send(self, data, flags=0):
@@ -669,7 +669,7 @@
This function still needs work WRT UDP.
"""
if len(self.writeQueue):
- flags, data, channel = self.writeQueue[0]
+ channel, flags, data = self.writeQueue[0]
del self.writeQueue[0]

# asyncore does not expose sending the flags.

Reply all
Reply to author
Forward
0 new messages