'recv, which will only block current greenlet
state_changed always fires exactly once (success or fail) at the
end of this method.'

def recv(self, flags=0, copy=True, track=False):

    if (flags & zmq.NOBLOCK):
        try:
            msg = super(_Socket, self).recv(flags, copy, track)
        finally:
            if (not self.__in_recv_multipart):
                self.__state_changed()
        return msg
    flags |= zmq.NOBLOCK
    while True:
        try:
            msg = super(_Socket, self).recv(flags, copy, track)
        except zmq.ZMQError as e:
            if (e.errno != zmq.EAGAIN):
                if (not self.__in_recv_multipart):
                    self.__state_changed()
                raise
        else:
            if (not self.__in_recv_multipart):
                self.__state_changed()
            return msg
        self._wait_read()
