Re: [zeromq-dev] i can't see what i am doing wrong

2010-07-07 Thread Martin Lucina
On 6/7/2010, "Andrew Hume" wrote: >okay, i gather you sleep before you start. fine. > >i can do a handshake around the exit thing IF i can find out if >the context is finished its work. is there a way to do that? That's precisely what you can't do right now and what the thread Re. zmq_close() s

Re: [zeromq-dev] i can't see what i am doing wrong

2010-07-06 Thread Andrew Hume
okay, i gather you sleep before you start. fine. i can do a handshake around the exit thing IF i can find out if the context is finished its work. is there a way to do that? On Jul 6, 2010, at 3:23 PM, Brian Granger wrote: On Tue, Jul 6, 2010 at 9:52 AM, Martin Lucina wrote: elliso...@gmail.

Re: [zeromq-dev] i can't see what i am doing wrong

2010-07-06 Thread Brian Granger
On Tue, Jul 6, 2010 at 9:52 AM, Martin Lucina wrote: > elliso...@gmail.com said: >> I have run into this many times.  The issue is that the SUB socket >> doesn't get the messages until it actually connects: >> >> If the PUB starts before the SUB, the PUB will start broadcasting >> before the SUB s

Re: [zeromq-dev] i can't see what i am doing wrong

2010-07-06 Thread Martin Lucina
elliso...@gmail.com said: > I have run into this many times. The issue is that the SUB socket > doesn't get the messages until it actually connects: > > If the PUB starts before the SUB, the PUB will start broadcasting > before the SUB starts and the SUB won't get those messages that were > sent

Re: [zeromq-dev] i can't see what i am doing wrong

2010-07-05 Thread Matt Weinstein
On Jul 5, 2010, at 7:06 PM, Brian Granger wrote: > I have run into this many times. The issue is that the SUB socket > doesn't get the messages until it actually connects: > > If the PUB starts before the SUB, the PUB will start broadcasting > before the SUB starts and the SUB won't get those me

Re: [zeromq-dev] i can't see what i am doing wrong

2010-07-05 Thread Andrew Hume
gosh, that was helpful! this seems like odd semantics but i'll take your word for it. exactly what do i synchronise? as you may have surmised, i knew enough to start the PUB after the SUB. but exactly what dance do i need? send a sacrificial message from pub (that presumably lets the SUB get i

Re: [zeromq-dev] i can't see what i am doing wrong

2010-07-05 Thread Brian Granger
I have run into this many times. The issue is that the SUB socket doesn't get the messages until it actually connects: If the PUB starts before the SUB, the PUB will start broadcasting before the SUB starts and the SUB won't get those messages that were sent before the SUB connects. A PUB socket

[zeromq-dev] i can't see what i am doing wrong

2010-07-05 Thread Andrew Hume
folks, i am doing a simple case and can't see my error: in process a: ctxt = zmq_init(1, 5, 0); q = zmq_socket(ctxt, ZMQ_PUB); sprintf(buf, "tcp://%s:%s", machine, port); n = zmq_connect(q, buf); for(n = 0; n < 2050; n++){ get_goo(