[Time] Name | Message |
[07:22] stockMQ
|
Hi.. I am using protobuf to PUB data.. at the SUB end i deserialize it to a protobuf message
|
[07:23] stockMQ
|
but the i need to copy the protobuf message to a struct and write the struct to a file..
|
[07:23] stockMQ
|
I need to do this because there are other applications consuming the file and they expect a struct
|
[07:24] stockMQ
|
right now i copy each field of the message to the corresponding field of the buffer
|
[07:24] stockMQ
|
Is this the right way or is there any other optimized way to go about with it
|
[08:20] mikko
|
stockMQ: are the other applications expecting a binary struct?
|
[08:20] mikko
|
stockMQ: sounds odd
|
[08:25] stockMQ
|
yes.. they too are custom applications built in house but to change them is to be avoided
|
[09:24] CIA-21
|
zeromq2: 03Martin Sustrik 07sub-forward * raddcc85 10/ devices/zmq_forwarder/zmq_forwarder.cpp :
|
[09:24] CIA-21
|
zeromq2: Forwarder device uses XPUB and XSUB sockets.
|
[09:24] CIA-21
|
zeromq2: Signed-off-by: Martin Sustrik <sustrik@250bpm.com> - http://bit.ly/eoHfSJ
|
[09:28] jugg
|
having a publisher that connects to an endpoint, how would I prevent messages from being queued if the endpoint has not yet been bound? Set the publisher HWM to zero, and call zmq_send(noblock)?
|
[09:32] sustrik
|
yes, use hwm
|
[09:33] jugg
|
hmm, I guess HWM = 1, as 0 is no limit...
|
[09:34] jugg
|
but that'll queue a single message, no?
|
[09:34] jugg
|
So a stale message will be delivered when the listener binds the endpoint.
|
[09:57] sustrik
|
it that pub/sub?
|
[10:06] ianbarber
|
potentially silly bug: if I destroy then recreate a sub socket with an identity too quickly I get an assert "Assertion failed: new_sndbuf > old_sndbuf (mailbox.cpp:182)" from the publisher
|
[10:06] ianbarber
|
this may not be something that is sensible to do, but i encountered it in a semi-real world usage (some prototype code)
|
[10:12] CIA-21
|
zeromq2: 03Martin Sustrik 07sub-forward * rca34d2a 10/ (5 files):
|
[10:12] CIA-21
|
zeromq2: Debug output for subscription forwarding.
|
[10:12] CIA-21
|
zeromq2: Signed-off-by: Martin Sustrik <sustrik@250bpm.com> - http://bit.ly/fdwCNa
|
[10:34] ianbarber
|
ah, it's because the publisher thinks it has two sockets with the same identity connected at the same time. It would be nice to have that cause a problem on the client side, rather than the server side, but I don't know if that's doable
|
[10:37] mikko
|
i dont think two identities should assert
|
[10:41] ianbarber
|
mikko: i haven't made a testcase in C yet, but in PHP
|
[10:42] ianbarber
|
https://gist.github.com/805688
|
[10:43] ianbarber
|
if anything was going to assert, i'd much rather it be the client
|
[10:43] ianbarber
|
but i think the best behavior would be a failed connect()
|
[10:44] ianbarber
|
not sure how easy it is to compare a new identity against connected identities on connect though, from the pub side
|
[10:47] ianbarber
|
ooh, if this works in c, this is worth a point in the 0mq game :)
|
[10:53] ianbarber
|
same thing in C: https://gist.github.com/805701
|
[10:57] ianbarber
|
yep, and if I split that into client server, it still happens
|
[11:02] CIA-21
|
zeromq2: 03Martin Sustrik 07sub-forward * rcc7bed5 10/ (src/trie.cpp src/trie.hpp src/xsub.cpp):
|
[11:02] CIA-21
|
zeromq2: Duplicate subscriptions are not forwarded by XSUB socket.
|
[11:02] CIA-21
|
zeromq2: Signed-off-by: Martin Sustrik <sustrik@250bpm.com> - http://bit.ly/hGPp1V
|
[11:24] suzan_shakya
|
Is it possible to have mulitple publisher with PUB/SUB ?
|
[11:39] stockMQ
|
Hi..what would be the equivalent of zmq_close (sender); zmq_term (context);
|
[11:39] stockMQ
|
in C++
|
[11:40] mikko
|
stockMQ: object going out of scope
|
[11:40] mikko
|
its called during destruction
|
[11:41] stockMQ
|
ok..So in order to say premptively stop the socket for some time can i just pause the thread for the duration
|
[15:40] stockMQ
|
Is there a way we can exit out of the blocking zmq_recv
|
[15:42] sustrik
|
send it a message
|
[15:44] stockMQ
|
The issue is I have a thread with basic while(1){zmq_recv }..Now in the Main UI thread I have a Disconnect button,clicking on which an event message is sent to the socket thread asking it to quit gracefully.But due to the blocking message of the socket thread that message is never read
|
[15:45] sustrik
|
you have to poll on both sockets
|
[15:45] sustrik
|
instead of recv()ing on one of them
|
[15:46] stockMQ
|
Ohk.. you mean i can have one tcp main socket and apart from that inprc sockets for communication between Main UI thread and child UI thread
|
[15:48] stockMQ
|
is that right
|
[15:50] sustrik
|
yes
|
[15:51] stockMQ
|
ok thanx
|
[17:46] andrewvc
|
any ideas what broken pipe, nbytes != 1 errors are caused by?
|
[17:50] sustrik
|
what's the assertion?
|
[18:28] CIA-21
|
jzmq: 03robin.palotai 07master * r04c2900 10/ src/Poller.cpp : testing patch for jni crashes - http://bit.ly/hlc8vI
|
[19:05] andrewvc
|
cremes: around?
|
[19:05] andrewvc
|
I was wondering if you noticed issues with pub/sub and ZMQ::NOBLOCK in the past
|
[19:05] cremes
|
andrewvc: yep
|
[19:06] cremes
|
nope, i have not noticed any specific issues with pub/sub
|
[19:06] andrewvc
|
hmmmm
|
[19:06] andrewvc
|
so in my work on em-zeromq, push/pull works well, pub/sub however
|
[19:06] cremes
|
what's it doing?
|
[19:06] andrewvc
|
zmq_recv just doesn't pick anything up
|
[19:06] cremes
|
or not doing?
|
[19:06] andrewvc
|
the FD gets triggered as readable
|
[19:06] andrewvc
|
on the sub
|
[19:06] cremes
|
so pub works but sub is busted?
|
[19:06] andrewvc
|
yeah
|
[19:06] andrewvc
|
i straced it
|
[19:06] andrewvc
|
i see the data getting written and read
|
[19:06] andrewvc
|
and ZMQ_EVENTS says POLLOUT is enabled
|
[19:06] andrewvc
|
errr triggered
|
[19:07] andrewvc
|
but recv doesn't work
|
[19:07] cremes
|
which socket are you talking about here? sub sockets don't care about POLLOUT
|
[19:07] andrewvc
|
errrm, I meant pollin
|
[19:07] cremes
|
they need POLLIN
|
[19:07] andrewvc
|
sorry
|
[19:07] cremes
|
ok
|
[19:07] andrewvc
|
wait, actually
|
[19:07] cremes
|
damn, thought we had the fix right there...
|
[19:08] andrewvc
|
i think they were triggering POLLOUT (according to ZMQ::EVENTS) on a ZMQSUB socket
|
[19:08] andrewvc
|
lemme double check that
|
[19:12] andrewvc
|
hmmm
|
[19:12] andrewvc
|
now I see no events on the socket, which is good and bad
|
[19:13] andrewvc
|
i mean, the same exact code works with pub/sub
|
[19:13] andrewvc
|
errr push/pull
|
[19:14] andrewvc
|
[pid 14619] sendto(22, "\10\0TMsg777", 9, 0, NULL, 0 <unfinished ...>
|
[19:14] andrewvc
|
[pid 14619] <... recvfrom resumed> "\10\0TMsg777", 8192, 0, NULL, NULL) = 9
|
[19:14] andrewvc
|
from the strace
|
[19:14] andrewvc
|
so, internally, the message gets sent/received
|
[19:14] andrewvc
|
by zeromq it looks
|
[19:15] andrewvc
|
cremes: any ideas on that? I can dig into ffi-rzmq tonight I guess
|
[19:15] cremes
|
andrewvc: can you gist your test code for me; i'd like to look at it
|
[19:17] andrewvc
|
sure, i mean, I'm a bit short on time now, about to head into a meeting. I can write a minimal test later
|
[19:17] andrewvc
|
however
|
[19:17] andrewvc
|
if you want you can look at
|
[19:17] andrewvc
|
however
|
[19:17] andrewvc
|
https://github.com/andrewvc/em-zeromq
|
[19:17] andrewvc
|
if you run this spec https://github.com/andrewvc/em-zeromq/blob/master/spec/em-zeromq_spec.rb
|
[19:17] cremes
|
i just wonder if i'll see something that you don't... hopefully it's an easy fix
|
[19:17] andrewvc
|
and s/ZMQ::PUSH/ZMQ::PUB
|
[19:17] andrewvc
|
and s/ZMQ::PULL/ZMQ::PUB
|
[19:17] andrewvc
|
you'll see it
|
[19:18] cremes
|
ok
|
[19:18] andrewvc
|
or I can send something later, I'll be expanding the test suite tonight
|
[19:52] CIA-21
|
zeromq2: 03Martin Sustrik 07sub-forward * ra40436b 10/ (5 files):
|
[19:52] CIA-21
|
zeromq2: Couple of bug fixes to subscription forwarding mechanism.
|
[19:52] CIA-21
|
zeromq2: Signed-off-by: Martin Sustrik <sustrik@250bpm.com> - http://bit.ly/eOAJxP
|
[20:14] mikko
|
good evening
|
[20:19] sustrik
|
evening
|