[nanomsg] Re: bus pattern?

  • From: André Jonsson <nanomsg@xxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Mon, 23 Sep 2013 12:42:19 +0200

On 2013-09-23 11:27, Paul Colomiets wrote:
Hi Andre,

On Mon, Sep 23, 2013 at 11:53 AM, André Jonsson <nanomsg@xxxxxx> wrote:
I thought it would be elegant to just create a bus that clients can send to and 
receive
messages from at their leisure, without knowing who else is on the bus

So how do you think they will find each other? Multicast? I just don't
see how it's possible. And nn_device or any device-like code would
solve your use case well.

Well, they are after all connected to the same bus. :)
But that assumes the bus is acting as a forwarder (kind of what busses usually do, see dbus) which it by default does not. A nn_device()-like thingy is what I need.

And using nn_device() is not an option as it is (currently) too difficult to
stop.

What's exactly too difficult?

If I'm not mistaken, the only way to stop it is calling nn_term(). That will shut down all sockets in the application, and stopping all sockets in the application just to stop one nn_device() might not be ideal in many cases, and isn't an option in my specific case. Something like closing the bus socket would be easier, but I don't know if that's even applicable; I know close to nothing of the internals of nanomsg.

Anyway you can just look at how nn_device is implemented and write you
own similar one, with a signalling interface. It may take an hour or
so.

Yeah, I guess that's what I have to do.

Anyway, thanks for putting me back on the track.

/André



Other related posts: