[nanomsg] Re: Bind random port

  • From: Martin Sustrik <sustrik@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Mon, 02 Jun 2014 12:47:58 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Thomas,

> I'm trying out nanomsg (with nanomsgxx) as an alternative to
> zeromq. I only have one issue: I was wondering is nanomsg offers to
> bind a random port and then later access to the binded port ? In
> another word, is there any equivalent to ZMQ_LAST_ENDPOINT?

No. There's no way to do that. The functionality can't possibly work
in a generic way.

Consider wi-fi interfaces. They come and go depending on whether wi-fi
is avialable or not.

So, nanomsg has to re-bind each time the interface becomes available
(not done yet but under works afaik). So, each time it gets a
different ephemeral port number.

- From user's point of view it means that the port number changes
silently at random times and that you can't depend on the value
retrieved via ZMQ_LAST_ENDPOINT.

Not a good problem to have.

Martin

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTjFZeAAoJENTpVjxCNN9Y15EH/26oYKChAvPLA6u0kGnfb+5p
RTR/IBm+bhWCa7oyN9sj5HsvWwZOzBcYdf2icWnz+fqJk9Vw0ge2uhiZpdjD3XKp
ccnzdel25oTBatnwxWllMr9ezVgrD4yNcYUDv3RAbnFetuGsqUTrDNS9+9LmLwVa
oc577/MnIhINsBVnNnOKNckco1uVYGjrb1e5d/9RhhmBia4sErRKGUtFqld5W7Og
AL49WtUR/nvT1MBZamN9wGZh2dCXmkFEmPz/JvRU9+M4uzCYbL6+TPwquY7B2J6W
HEuwm8cCXWN9HXh5Zw+lGNSs+b9pkJT6iInFSgFfKZfCo3NYp8CBoDo+7w2Tl6s=
=wQgS
-----END PGP SIGNATURE-----

Other related posts: