[zeromq-dev] is this allowed?

Andrew Hume andrew at research.att.com
Wed Sep 19 15:15:55 CEST 2012


i have a situation where i sometimes store messages for a while before sending on.
is this code safe (in terms of message handling)?

	zmq_msg_t msg, buf[2000];

	zmq_msg_init(&msg);
	zmq_recv(sock, &msg, 0);
	if(cond)
		buf[i++] = msg;
	else
		zmq_msg_close(&msg);

	...

	for(j = 0; j < i; j++){
		zmq_send(osock, &buf[j], 0);
		zmq_msg_close(&buf[j]);
	}

initial evidence indicates stuff is happening behind my back but before i spend
a lot of time debugging that, i wanted to ensure that this is even possible.

thanks

	

------------------
Andrew Hume  (best -> Telework) +1 623-551-2845
andrew at research.att.com  (Work) +1 973-236-2014
AT&T Labs - Research; member of USENIX and LOPSA




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120919/ff878a03/attachment.html>


More information about the zeromq-dev mailing list