On Thu, 2010-09-09 at 10:22 +0200, Pieter Hintjens wrote: > David, > > Well, I tried this code. First, removed the sleep(10) in the worker thread... >
The sleep(10) was just to give all the workers a chance to bind, before the connect in the main thread. > - it crashed once, duplicate free(). > - client sometimes got 1 reply, sometimes 2 replies, sometimes 0 replies > - sometimes, xrep.cpp reported (I added a trace) an unknown identity on send() > - but mostly xrep.cpp didn't report any error and it still hung > > Then I reduced it to 1 worker and it still didn't run further. So is > 10 workers really a minimal test case? > I can be less than 10. But it has to be in a worker thread to expose the problem. While it recieves messages from the REP socket in the thread, it fails to send on the pub skt through inproc channel. This cannot be simply in a main thread, since it works fine when binding to a single PUB skt - i.e. if it is just one thread and you bind the single PUB skt right to eth1 (or lo) interface, it works fine. It is seems to be specific to inproc. > I'll look at it further but please, strip it down until it really is > minimal. You can: > > * bind to * instead of individual interfaces Not really sure what the "*" does, nor how that simplifies things, but i'll keep that in mind. > * use asserts around calls instead of error reporting (for a test) > > Also, explain what output we're *supposed* to see, because I'm > guessing, which is pointless, that the client is supposed to get > endless replies. ok. The client app (second program) is merely there to send a stream of messages to the first program. Run it in two different shells. The first one will print out what it is sending. The second wone will print out what it is recieving as it recieves it in the worker thread. there is code in main to forward the messages from the inproc socket to the main pub skt and print out a message. None of which is printed out. You should see the messages being recieved by the worker socket, but not by the forwarder. > > -Pieter > > On Wed, Sep 8, 2010 at 11:31 PM, david starkweather <[email protected]> > wrote: > > Hello ! > > > > I managed to replicate the problem I've been having in this code > > example. > > > > http://pastebin.com/5Lsy47Cj > > > > The top program is a req/rep server that fields multipart messages with > > multiple threads and relays them to a sub socket in the main thread via > > inproc pipes. There is then a custom forward loop at the end of main to > > forward the messages to the main pub skt. > > > > The second program is a client app to send the messages to the server > > program. > > > > The problem is occurring when it fails to publish the messages to the > > subskt. Anyone have any ideas ? thanks. > > > > to compile: gcc -otestpub testpub.c -lzmq > > > > DGS. > > > > > > > > _______________________________________________ > > zeromq-dev mailing list > > [email protected] > > http://lists.zeromq.org/mailman/listinfo/zeromq-dev > > > > > > > _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
