[zeromq-dev] [zmqpp] receiving can only be done to empty messages?
Ben Gray
ben at benjamg.com
Wed Jan 8 11:14:02 CET 2014
On 7 January 2014 17:06, Lindley French <lindleyf at gmail.com> wrote:
> At the same time I'm going to strongly suggest reviewing the assertion:
> assert(EAGAIN == zmq_errno());
> in the same function. I'm frequently getting EINTR here and failing the
> assertion when I run in gdb. (I think gdb throws a lot more signals than
> you'd normally get.)
>
>
>
I'm pretty sure the assert should be checking we never get EAGAIN on
anything but the first frame of a message, which means the assert should be
inverted as it's doing the opposite right now.
It also looks as though the socket will have read the first few frames of a
message on an exception from anything but the first part. This leaves it in
a state not particularly useful for zmqpp.
This is also true of sending, although in that case I'm pretty sure the
only error code should be the EINTR so there might be something clever we
can do to fix that.
What are peoples thoughts on this? there isn't exactly a way to roll back
receiving or sending of the first X frames on a message.
Possibly a function to query for incomplete messages and to allow sending /
receiving of the remainder of a message?
Theoretically we could retry that frame on EINTR but I'd be hesitant to do
that as it means ignoring the signal raised until the whole message is
processed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140108/d48b5aae/attachment.htm>
More information about the zeromq-dev
mailing list