[nanomsg] Re: different protocols, parameters

  • From: Paul Colomiets <paul@xxxxxxxxxxxxxx>
  • To: "Garrett D'Amore" <garrett@xxxxxxxxxx>
  • Date: Tue, 11 Mar 2014 20:46:36 +0200

Hi Garrett,

On Tue, Mar 11, 2014 at 7:58 PM, Garrett D'Amore <garrett@xxxxxxxxxx> wrote:
> Can you shed any more light on the matter?
>

From the top of my head:

1. If encryption is done using socket options. Current python bindings
will just work, without any effort of binding maintainers (many other
similarly)

2. Same can be done for nanoconfig and topologist and similar tools

3. If application support encryption optionally it will not fail with
linker error on old version of library but rather not provide
functionality (by returning EINVAL from nn_setsockopt)

>> Good point! But you still need access to a transport to the peer. That's
>> not always possible in a web server environment. (I guess maybe you do get
>> stdin/stdout though?)
>>
>
> Not sure what you mean. Probably you want something like,
> the ``--exec`` option for nanocat, which will work something like this:
>
> $ nanocat --rep -Xsock --exec sh -c 'echo Hello, $1!' &
> $ nanocat --req -Axsock --data "Nanomsg"
> Hello, Nanomsg!
>
> Admittedly I've not played around much with nanocat.  But you're using IPC
> transports (sock).  Imagine that instead of using a socket, you want to use
> stdin for recv, and stdout for send, and the "connect" operation was handed
> to you already formed.  That's the sort of environment that I think a script
> running in a webserver gets.  Similar to things running out of inetd,
> actually.  Its a hack, and you definitely don't want to use it on a client
> side.  But for a simple req style server, where the service is a trivial RPC
> style backend, hey, it would work fine.  After all, req sockets don't need
> to do anything special, and they don't reconnect.  The reconnect/retry is
> done by the client.
>

That's what I meant with --exec option. It would execute a
command-line and forward a message to it, then read it's stdin and
send that data back as a reply. Implementing such an option is easy
and straightforward unlike the nanomsg -> CGI mapping.

-- 
Paul

Other related posts: