diff options
Diffstat (limited to 'src/protocol/reqrep')
| -rw-r--r-- | src/protocol/reqrep/rep.c | 12 | ||||
| -rw-r--r-- | src/protocol/reqrep/req.c | 19 |
2 files changed, 25 insertions, 6 deletions
diff --git a/src/protocol/reqrep/rep.c b/src/protocol/reqrep/rep.c index c7546182..1adfd0f8 100644 --- a/src/protocol/reqrep/rep.c +++ b/src/protocol/reqrep/rep.c @@ -488,10 +488,16 @@ static nni_proto_sock_ops nni_rep_sock_ops = { }; nni_proto nni_rep_proto = { - .proto_self = NNG_PROTO_REP, - .proto_peer = NNG_PROTO_REQ, - .proto_name = "rep", + .proto_version = NNI_PROTOCOL_VERSION, + .proto_self = { NNG_PROTO_REP_V0, "rep" }, + .proto_peer = { NNG_PROTO_REQ_V0, "req" }, .proto_flags = NNI_PROTO_FLAG_SNDRCV, .proto_sock_ops = &nni_rep_sock_ops, .proto_pipe_ops = &nni_rep_pipe_ops, }; + +int +nng_rep0_open(nng_socket *sidp) +{ + return (nni_proto_open(sidp, &nni_rep_proto)); +} diff --git a/src/protocol/reqrep/req.c b/src/protocol/reqrep/req.c index 7ec53c90..d0dd3887 100644 --- a/src/protocol/reqrep/req.c +++ b/src/protocol/reqrep/req.c @@ -112,6 +112,12 @@ nni_req_sock_init(void **reqp, nni_sock *sock) } static void +nni_req_sock_open(void *arg) +{ + NNI_ARG_UNUSED(arg); +} + +static void nni_req_sock_close(void *arg) { nni_req_sock *req = arg; @@ -626,6 +632,7 @@ static nni_proto_pipe_ops nni_req_pipe_ops = { static nni_proto_sock_ops nni_req_sock_ops = { .sock_init = nni_req_sock_init, .sock_fini = nni_req_sock_fini, + .sock_open = nni_req_sock_open, .sock_close = nni_req_sock_close, .sock_setopt = nni_req_sock_setopt, .sock_getopt = nni_req_sock_getopt, @@ -634,10 +641,16 @@ static nni_proto_sock_ops nni_req_sock_ops = { }; nni_proto nni_req_proto = { - .proto_self = NNG_PROTO_REQ, - .proto_peer = NNG_PROTO_REP, - .proto_name = "req", + .proto_version = NNI_PROTOCOL_VERSION, + .proto_self = { NNG_PROTO_REQ_V0, "req" }, + .proto_peer = { NNG_PROTO_REP_V0, "rep" }, .proto_flags = NNI_PROTO_FLAG_SNDRCV, .proto_sock_ops = &nni_req_sock_ops, .proto_pipe_ops = &nni_req_pipe_ops, }; + +int +nng_req0_open(nng_socket *sidp) +{ + return (nni_proto_open(sidp, &nni_req_proto)); +} |
