Permalink
Browse files

eliminate small difference between py and pyx

  • Loading branch information...
1 parent c96b918 commit e3b27095b4ec7ee3d17e7a60ca6678c82d06fdf1 @tmc committed Jan 30, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 gevent_zeromq/core.py
View
@@ -100,10 +100,12 @@ def _wait_read(self):
def send(self, data, flags=0, copy=True, track=False):
# Marker as to if we've encountered EAGAIN yet. Required have zmq work well with deallocating many sockets
num_eagains = 0
+ # ensure the zmq.NOBLOCK flag is part of flags
+ flags |= zmq.NOBLOCK
while True: # Attempt to complete this operation indefinitely, blocking the current greenlet
try:
- # attempt the actual call, ensuring the zmq.NOBLOCK flag
- return super(Socket, self).send(data, flags|zmq.NOBLOCK, copy, track)
+ # attempt the actual call
+ return super(Socket, self).send(data, flags, copy, track)
except zmq.ZMQError, e:
# if the raised ZMQError is not EAGAIN, reraise
if e.errno != zmq.EAGAIN:
@@ -117,9 +119,10 @@ def send(self, data, flags=0, copy=True, track=False):
def recv(self, flags=0, copy=True, track=False):
num_eagains = 0
+ flags |= zmq.NOBLOCK
while True:
try:
- return super(Socket, self).recv(flags|zmq.NOBLOCK, copy, track)
+ return super(Socket, self).recv(flags, copy, track)
except zmq.ZMQError, e:
if e.errno != zmq.EAGAIN:
raise

0 comments on commit e3b2709

Please sign in to comment.