From 45f455064b5704f3d5ed8ecf9f197a18fe72ee59 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 4 Apr 2018 12:37:34 -0700 Subject: fixes #331 replace NNG_OPT_RAW option with constructor This makes the raw mode something that is immutable, determined at socket construction. This is an enabling change for the separate context support coming soon. As a result, this is an API breaking change for users of the raw mode option (NNG_OPT_RAW). There aren't many of them out there. Cooked mode is entirely unaffected. There are changes to tests and documentation included. --- src/core/protocol.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/core/protocol.h') diff --git a/src/core/protocol.h b/src/core/protocol.h index 01e3d11c..9b241138 100644 --- a/src/core/protocol.h +++ b/src/core/protocol.h @@ -127,10 +127,12 @@ struct nni_proto { // These flags determine which operations make sense. We use them so that // we can reject attempts to create notification fds for operations that make -// no sense. +// no sense. Also, we can detect raw mode, thereby providing handling for +// that at the socket layer (NNG_PROTO_FLAG_RAW). #define NNI_PROTO_FLAG_RCV 1 // Protocol can receive #define NNI_PROTO_FLAG_SND 2 // Protocol can send #define NNI_PROTO_FLAG_SNDRCV 3 // Protocol can both send & recv +#define NNI_PROTO_FLAG_RAW 4 // Protocol is raw // nni_proto_open is called by the protocol to create a socket instance // with its ops vector. The intent is that applications will only see -- cgit v1.2.3-70-g09d2