diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-01-01 12:44:02 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-01-01 12:44:02 -0800 |
| commit | 0d23af92531b7c0dd6d7b74c73c1a8c4811c7d13 (patch) | |
| tree | 2dc9ded3dfc724df42a360a9f2de359f406e537f /src/sp/protocol/reqrep0/xreq.c | |
| parent | f8a2abaf931557030fd6e6683617c6a7877eebf7 (diff) | |
| download | nng-0d23af92531b7c0dd6d7b74c73c1a8c4811c7d13.tar.gz nng-0d23af92531b7c0dd6d7b74c73c1a8c4811c7d13.tar.bz2 nng-0d23af92531b7c0dd6d7b74c73c1a8c4811c7d13.zip | |
protocols: move content from the protocols to nng.h
This should simplify things for developers. Just one header to include
in most cases now.
Diffstat (limited to 'src/sp/protocol/reqrep0/xreq.c')
| -rw-r--r-- | src/sp/protocol/reqrep0/xreq.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/sp/protocol/reqrep0/xreq.c b/src/sp/protocol/reqrep0/xreq.c index b0ff301b..2bf3b95e 100644 --- a/src/sp/protocol/reqrep0/xreq.c +++ b/src/sp/protocol/reqrep0/xreq.c @@ -1,5 +1,5 @@ // -// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a @@ -11,7 +11,11 @@ #include <stdio.h> #include "core/nng_impl.h" -#include "nng/protocol/reqrep0/req.h" + +#define REQ0_SELF 0x30 +#define REQ0_PEER 0x31 +#define REQ0_SELF_NAME "req" +#define REQ0_PEER_NAME "rep" // Request protocol. The REQ protocol is the "request" side of a // request-reply pair. This is useful for building RPC clients, for example. @@ -114,10 +118,10 @@ xreq0_pipe_start(void *arg) xreq0_pipe *p = arg; xreq0_sock *s = p->req; - if (nni_pipe_peer(p->pipe) != NNG_REQ0_PEER) { + if (nni_pipe_peer(p->pipe) != REQ0_PEER) { nng_log_warn("NNG-PEER-MISMATCH", "Peer protocol mismatch: %d != %d, rejected.", - nni_pipe_peer(p->pipe), NNG_REQ0_PEER); + nni_pipe_peer(p->pipe), REQ0_PEER); return (NNG_EPROTO); } @@ -305,8 +309,8 @@ static nni_proto_sock_ops xreq0_sock_ops = { static nni_proto xreq0_proto = { .proto_version = NNI_PROTOCOL_VERSION, - .proto_self = { NNG_REQ0_SELF, NNG_REQ0_SELF_NAME }, - .proto_peer = { NNG_REQ0_PEER, NNG_REQ0_PEER_NAME }, + .proto_self = { REQ0_SELF, REQ0_SELF_NAME }, + .proto_peer = { REQ0_PEER, REQ0_PEER_NAME }, .proto_flags = NNI_PROTO_FLAG_SNDRCV | NNI_PROTO_FLAG_RAW, .proto_sock_ops = &xreq0_sock_ops, .proto_pipe_ops = &xreq0_pipe_ops, |
