[nanomsg] Re: does nanomsg support multi producer in pub-sub mode?

  • From: "Garrett D'Amore" <garrett@xxxxxxxxxx>
  • To: "nanomsg@xxxxxxxxxxxxx" <nanomsg@xxxxxxxxxxxxx>
  • Date: Tue, 29 Dec 2015 10:11:53 -0800

Because nanomsg uses TCP, you can only have one process “listening” (i.e.
doing TCP accept.) This can indeed be the subscriber, as the role of
subscriber/publisher is orthogonal to the TCP client/server relationship.
That said, such a use case (having the subscriber be the one doing the
listen/bind/accept) is unconventional, but it will work.

On Tue, Dec 29, 2015 at 7:25 AM, 广州刘丹 <139250065@xxxxxx> wrote:

Dear Garrett:
Sorry! I didn't speak the question clearly. My real question is: Can
multi process(producer) post messages to same url(same message queue)? If
can, should each producer run nn_bind function?
With best regards
Daniel


------------------ 原始邮件 ------------------
*发件人:* "Garrett D'Amore";<garrett@xxxxxxxxxx>;
*发送时间:* 2015年12月29日(星期二) 晚上11:15
*收件人:* "nanomsg"<nanomsg@xxxxxxxxxxxxx>;
*主题:* [nanomsg] Re: does nanomsg support multi producer in pub-sub mode?

Yes. You can connect to multiple publishers and since the subscription is
merely a client side filter you will see the appropriate messages from both
subscribers.

Sent from my iPhone

On Dec 29, 2015, at 2:19 AM, 广州刘丹 <139250065@xxxxxx> wrote:

Dear all:
does nanomsg support multi producer in pub-sub mode?

with best regards
daniel

Other related posts: