[nanomsg] Re: Where "Channel ID" are managed in the code ?

  • From: zerotacg <zero@xxxxxxxxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Sun, 19 Jan 2014 16:45:25 +0100

On 18.01.2014 10:52, Laurent Alebarde wrote:
> I agree nn_socket ( AF_SP_RAW, NN_REP ) is what I need. I know I have to
> hack the library code to manipulate the channel IDs to achieve a
> statefull behaviour. But still, *I don't know if it is asynchronous*. To
> be more clear, if clients C1 and C2 send a request to the server. The
> server is composed of a REP/REP proxy and some REP workers, say W1 and W2.

if I'm not mistaken an RAW REP would be xrep (as in xrep.c) and the raw
ones are with out state logic, martin also mentioned that in an IRC log,
so you can just go recv recv ... send send as you want
for non-blocking see NN_DONTWAIT
as nanomsg is quite similar to 0mq I think it's save to assume XREP is
the nn equivalent of ROUTER
to try and answer the question from the subject [3] looks like it, for
REP, the pipe is linked to a nn_hash_item which has a key that seems to
correspond to the channel id

[1]
https://github.com/nanomsg/nanomsg/blob/master/src/protocols/reqrep/xrep.c#L148
[2]
https://github.com/nanomsg/nanomsg/blob/master/src/protocols/reqrep/xrep.c#L183
[3]
https://github.com/nanomsg/nanomsg/blob/master/src/protocols/reqrep/xrep.c#L98

Other related posts: