[zeromq-dev] basic_istream/ostream
Matt Weinstein
matt_weinstein at yahoo.com
Mon Aug 2 15:44:27 CEST 2010
On Aug 1, 2010, at 8:12 PM, Brian Granger wrote:
>
>
> On Sun, Aug 1, 2010 at 2:00 PM, Martin Sustrik <sustrik at 250bpm.com>
> wrote:
> Matt Weinstein wrote:
>
> > As an aside, I just can't wait to write:
> >
> > socket >> msgs
>
> In theory, each << could create a new message part. Then there could
> be
> a special endm (end of message operator) that would write an empty
> message with MORE flag not set:
>
> socket << 1 << "abc" << 2 << endm;
>
>
> +1
>
+1
or just flush the final message with MORE not set. no need to create
special cases or distinguish empty messages, which may have a purpose
in the next layer protocol.
I'm already doing something like this with a simple flush class:
class push_stream {
bool empty;
zmq_msg_t msg_;
int send(msg) { send msg_, treasure msg }
int flush() { send msg_, mark empty }
};
it does require a zmq_msg_copy per send, to treasure packet n-1, which
is less efficient than I'd like.
Perhaps it would be possible to add zmq_send_nomore(), but I can't
find the "wire protocol" post on the site ?
> Just an idea. Maybe even not a particularly good one :)
>
> Martin
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
>
> --
> Brian E. Granger, Ph.D.
> Assistant Professor of Physics
> Cal Poly State University, San Luis Obispo
> bgranger at calpoly.edu
> ellisonbg at gmail.com
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100802/d63cb93b/attachment.htm>
More information about the zeromq-dev
mailing list