[nanomsg] Re: more nng API changes

  • From: Michael Powell <mwpowellhtx@xxxxxxxxx>
  • To: "nanomsg@xxxxxxxxxxxxx" <nanomsg@xxxxxxxxxxxxx>
  • Date: Wed, 1 Nov 2017 10:39:54 -0400

On Tue, Oct 31, 2017 at 8:42 PM, Garrett D'Amore <garrett@xxxxxxxxxx> wrote:

Hi all,

A few things coming down… (if you’re not testing nng yet, you can ignore
this).

a) I’ve already removed the nng_peer() and nng_protocol() are gone.
Further, I’ve moved the protocol numbers away too — you don’t need them.

You'd better put the enum back in so that folks who may want to extend
with custom protocols do not inadvertently collide with the OOB
protocols.

b) Coming soon, protocols and transports will be modularized — the
“protovers” branch carries my work in progress here.  Basically you can
compile-time enable each of these things (everything except zerotier is
on-by-default), so you can make a smaller library (e.g. for tiny
environments.)

c) The protocols and transports are gaining their own header files, e.g. for
pairv1 you do #include <nng/protocol/pair1/pair.h>   This way I don’t have
to have knowledge of the protocols in the core anywhere (other than cmake
files).  It also lets me supply “default” version independent APIs nicely.
E.g. in the pairv1 header nng_pair_open() is defined to nng_pair1_open, but
in the v0 header it is nng_pair0_open.  (These are conditionalized so you
*can* include both headers, but then you had best manually choose because
the first one #included “wins” in defining the default.)

Anyway, stay tuned for more.

 - Garrett


Other related posts: