From d64f12553eb6ceb67ed6f6a5b2ceb6c061d375ba Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 8 Aug 2017 21:19:09 -0700 Subject: fixes #44 open protocol by "name" (symbol) instead number fixes #38 Make protocols "pluggable", or at least optional This is a breaking change, as we've done away with the central registered list of protocols, and instead demand the user call nng_xxx_open() where xxx is a protocol name. (We did keep a table around in the compat framework though.) There is a nice way for protocols to plug in via an nni_proto_open(), where they can use a generic constructor that they use to build a protocol specific constructor (passing their ops vector in.) --- src/core/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/device.c') diff --git a/src/core/device.c b/src/core/device.c index cd0c8dfc..81aafc3d 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -80,8 +80,8 @@ nni_device(nni_sock *sock1, nni_sock *sock2) rv = NNG_EINVAL; goto out; } - if ((sock1->s_peer != sock2->s_protocol) || - (sock2->s_peer != sock1->s_protocol)) { + if ((sock1->s_peer_id.p_id != sock2->s_self_id.p_id) || + (sock2->s_peer_id.p_id != sock1->s_self_id.p_id)) { rv = NNG_EINVAL; goto out; } -- cgit v1.2.3-70-g09d2