aboutsummaryrefslogtreecommitdiff
path: root/src/core/socket.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-08-08 21:19:09 -0700
committerGarrett D'Amore <garrett@damore.org>2017-08-09 02:38:55 -0700
commitd64f12553eb6ceb67ed6f6a5b2ceb6c061d375ba (patch)
treef6bdac79578176f0d00528d191f862009e761eac /src/core/socket.h
parent5f0398de8edd1ed4ddbf6455c66273a6608aad9a (diff)
downloadnng-d64f12553eb6ceb67ed6f6a5b2ceb6c061d375ba.tar.gz
nng-d64f12553eb6ceb67ed6f6a5b2ceb6c061d375ba.tar.bz2
nng-d64f12553eb6ceb67ed6f6a5b2ceb6c061d375ba.zip
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.)
Diffstat (limited to 'src/core/socket.h')
-rw-r--r--src/core/socket.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/socket.h b/src/core/socket.h
index 54c1b4da..6824b04b 100644
--- a/src/core/socket.h
+++ b/src/core/socket.h
@@ -25,8 +25,9 @@ struct nni_socket {
nni_list_node s_node;
- uint16_t s_protocol;
- uint16_t s_peer;
+ nni_proto_id s_self_id;
+ nni_proto_id s_peer_id;
+
uint32_t s_flags;
nni_proto_pipe_ops s_pipe_ops;
@@ -67,7 +68,7 @@ extern void nni_sock_sys_fini(void);
extern int nni_sock_find(nni_sock **, uint32_t);
extern void nni_sock_rele(nni_sock *);
-extern int nni_sock_open(nni_sock **, uint16_t);
+extern int nni_sock_open(nni_sock **, const nni_proto *);
extern void nni_sock_close(nni_sock *);
extern void nni_sock_closeall(void);
extern int nni_sock_shutdown(nni_sock *);