diff options
| author | Garrett D'Amore <garrett@damore.org> | 2020-02-06 01:04:22 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2020-02-06 01:22:15 -0800 |
| commit | 105bb7216101514a4563252775bcbf1650abadc9 (patch) | |
| tree | fa9022535bf6b5e27e7fa5cbe985bc3ec6525470 | |
| parent | 11335aa5584ef689c9335df3a97668fe62b8418c (diff) | |
| download | nng-105bb7216101514a4563252775bcbf1650abadc9.tar.gz nng-105bb7216101514a4563252775bcbf1650abadc9.tar.bz2 nng-105bb7216101514a4563252775bcbf1650abadc9.zip | |
Convert SURVEY to use lmq and avoid message queues.
This should make survey a little faster (which may be of benefit).
But it will also enable us to eliminate one of the checks in the
message queue code (#814), making everything else go faster.
| -rw-r--r-- | src/protocol/pair1/pair.c | 22 | ||||
| -rw-r--r-- | src/protocol/survey0/survey.c | 365 |
2 files changed, 241 insertions, 146 deletions
diff --git a/src/protocol/pair1/pair.c b/src/protocol/pair1/pair.c index a3e87bf3..f564195d 100644 --- a/src/protocol/pair1/pair.c +++ b/src/protocol/pair1/pair.c @@ -41,7 +41,7 @@ struct pair1_sock { nni_list plist; bool started; bool poly; - nni_aio aio_get; + nni_aio aio_get; nni_stat_item stat_poly; nni_stat_item stat_raw; nni_stat_item stat_reject_mismatch; @@ -49,7 +49,7 @@ struct pair1_sock { nni_stat_item stat_ttl_drop; nni_stat_item stat_rx_malformed; nni_stat_item stat_tx_malformed; - nni_stat_item stat_tx_drop; + nni_stat_item stat_tx_drop; }; // pair1_pipe is our per-pipe protocol private structure. @@ -111,8 +111,8 @@ pair1_sock_init_impl(void *arg, nni_sock *sock, bool raw) nni_sock_add_stat(sock, &s->stat_ttl_drop); // This can only increment in polyamorous mode. - nni_stat_init_atomic(&s->stat_tx_drop, "tx_drop", - "messages dropped undeliverable"); + nni_stat_init_atomic( + &s->stat_tx_drop, "tx_drop", "messages dropped undeliverable"); nni_stat_set_unit(&s->stat_tx_drop, NNG_UNIT_MESSAGES); nni_sock_add_stat(sock, &s->stat_tx_drop); @@ -129,11 +129,11 @@ pair1_sock_init_impl(void *arg, nni_sock *sock, bool raw) nni_sock_add_stat(sock, &s->stat_tx_malformed); } - s->sock = sock; - s->raw = raw; - s->poly = false; - s->uwq = nni_sock_sendq(sock); - s->urq = nni_sock_recvq(sock); + s->sock = sock; + s->raw = raw; + s->poly = false; + s->uwq = nni_sock_sendq(sock); + s->urq = nni_sock_recvq(sock); nni_atomic_init(&s->ttl); nni_atomic_set(&s->ttl, 8); @@ -191,8 +191,8 @@ pair1_pipe_init(void *arg, nni_pipe *pipe, void *pair) return (rv); } - p->pipe = pipe; - p->pair = pair; + p->pipe = pipe; + p->pair = pair; return (0); } diff --git a/src/protocol/survey0/survey.c b/src/protocol/survey0/survey.c index 999b8a56..6469251a 100644 --- a/src/protocol/survey0/survey.c +++ b/src/protocol/survey0/survey.c @@ -23,90 +23,172 @@ typedef struct surv0_pipe surv0_pipe; typedef struct surv0_sock surv0_sock; typedef struct surv0_ctx surv0_ctx; -static void surv0_pipe_getq_cb(void *); static void surv0_pipe_send_cb(void *); static void surv0_pipe_recv_cb(void *); static void surv0_ctx_timeout(void *); struct surv0_ctx { surv0_sock * sock; - uint64_t survid; // survey id + uint64_t survey_id; // survey id nni_timer_node timer; nni_time expire; - nni_duration survtime; - nni_msgq * rq; // recv message queue + nni_lmq recv_lmq; + nni_list recv_queue; + nni_atomic_int recv_buf; + nni_atomic_int survey_time; + int err; }; // surv0_sock is our per-socket protocol private structure. struct surv0_sock { - int ttl; - nni_list pipes; - nni_mtx mtx; - surv0_ctx ctx; - nni_idhash * surveys; - nni_pollable writable; + int ttl; + nni_list pipes; + nni_mtx mtx; + surv0_ctx ctx; + nni_idhash * surveys; + nni_pollable writable; + nni_pollable readable; + nni_atomic_int send_buf; }; // surv0_pipe is our per-pipe protocol private structure. struct surv0_pipe { - nni_pipe * npipe; + nni_pipe * pipe; surv0_sock * sock; - nni_msgq * sendq; + nni_lmq send_queue; nni_list_node node; - nni_aio * aio_getq; nni_aio * aio_send; nni_aio * aio_recv; + bool busy; + bool closed; }; static void -surv0_ctx_fini(void *arg) +surv0_ctx_abort(surv0_ctx *ctx, int err) { - surv0_ctx *ctx = arg; + nni_aio * aio; + surv0_sock *sock = ctx->sock; - if (ctx->rq != NULL) { - nni_msgq_close(ctx->rq); - nni_msgq_fini(ctx->rq); + while ((aio = nni_list_first(&ctx->recv_queue)) != NULL) { + nni_list_remove(&ctx->recv_queue, aio); + nni_aio_finish_error(aio, err); + } + nni_lmq_flush(&ctx->recv_lmq); + if (ctx->survey_id != 0) { + nni_idhash_remove(sock->surveys, ctx->survey_id); + ctx->survey_id = 0; + } + if (ctx == &sock->ctx) { + nni_pollable_clear(&sock->readable); } - nni_timer_cancel(&ctx->timer); } -static int -surv0_ctx_init(void *carg, void *sarg) +static void +surv0_ctx_close(surv0_ctx *ctx) { - surv0_ctx * ctx = carg; - surv0_sock *sock = sarg; - int rv; + surv0_sock *sock = ctx->sock; nni_mtx_lock(&sock->mtx); - ctx->survtime = sock->ctx.survtime; + surv0_ctx_abort(ctx, NNG_ECLOSED); nni_mtx_unlock(&sock->mtx); +} + +static void +surv0_ctx_fini(void *arg) +{ + surv0_ctx * ctx = arg; + + surv0_ctx_close(ctx); + nni_timer_cancel(&ctx->timer); + nni_lmq_fini(&ctx->recv_lmq); +} + +static int +surv0_ctx_init(void *c, void *s) +{ + surv0_ctx * ctx = c; + surv0_sock * sock = s; + int rv; + int len; + nng_duration tmo; + + nni_aio_list_init(&ctx->recv_queue); + nni_atomic_init(&ctx->recv_buf); + nni_atomic_init(&ctx->survey_time); + + if (ctx == &sock->ctx) { + len = 128; + tmo = NNI_SECOND; // survey timeout + } else { + len = nni_atomic_get(&sock->ctx.recv_buf); + tmo = nni_atomic_get(&sock->ctx.survey_time); + } + + nni_atomic_set(&ctx->recv_buf, len); + nni_atomic_set(&ctx->survey_time, tmo); + ctx->sock = sock; - // 126 is a deep enough queue, and leaves 2 extra cells for the - // push back bit. This can result in up to 1kB of allocation - // for the message queue. - if ((rv = nni_msgq_init(&ctx->rq, 126)) != 0) { + + if ((rv = nni_lmq_init(&ctx->recv_lmq, len)) != 0) { surv0_ctx_fini(ctx); return (rv); } - nni_timer_init(&ctx->timer, surv0_ctx_timeout, ctx); return (0); } static void +surv0_ctx_cancel(nni_aio *aio, void *arg, int rv) +{ + surv0_ctx * ctx = arg; + surv0_sock *sock = ctx->sock; + nni_mtx_lock(&sock->mtx); + if (nni_list_active(&ctx->recv_queue, aio)) { + nni_list_remove(&ctx->recv_queue, aio); + nni_aio_finish_error(aio, rv); + } + nni_mtx_unlock(&sock->mtx); +} + +static void surv0_ctx_recv(void *arg, nni_aio *aio) { surv0_ctx * ctx = arg; surv0_sock *sock = ctx->sock; + nni_msg * msg; + + if (nni_aio_begin(aio) != 0) { + return; + } nni_mtx_lock(&sock->mtx); - if (ctx->survid == 0) { + if (ctx->survey_id == 0) { nni_mtx_unlock(&sock->mtx); nni_aio_finish_error(aio, NNG_ESTATE); return; } - nni_msgq_aio_get(ctx->rq, aio); +again: + if (nni_lmq_getq(&ctx->recv_lmq, &msg) != 0) { + int rv; + if ((rv = nni_aio_schedule(aio, &surv0_ctx_cancel, ctx)) != + 0) { + nni_mtx_unlock(&sock->mtx); + nni_aio_finish_error(aio, rv); + return; + } + nni_list_append(&ctx->recv_queue, aio); + nni_mtx_unlock(&sock->mtx); + return; + } + if (nni_lmq_empty(&ctx->recv_lmq) && (ctx == &sock->ctx)) { + nni_pollable_clear(&sock->readable); + } + if ((msg = nni_msg_unique(msg)) == NULL) { + goto again; + } + nni_mtx_unlock(&sock->mtx); + nni_aio_finish_msg(aio, msg); } void @@ -120,49 +202,44 @@ surv0_ctx_timeout(void *arg) nni_mtx_unlock(&sock->mtx); return; } + // Abort any pending receives. - nni_msgq_set_get_error(ctx->rq, NNG_ETIMEDOUT); - if (ctx->survid != 0) { - nni_idhash_remove(sock->surveys, ctx->survid); - ctx->survid = 0; - } + surv0_ctx_abort(ctx, NNG_ETIMEDOUT); nni_mtx_unlock(&sock->mtx); } static void surv0_ctx_send(void *arg, nni_aio *aio) { - surv0_ctx * ctx = arg; - surv0_sock *sock = ctx->sock; - surv0_pipe *pipe; - nni_msg * msg = nni_aio_get_msg(aio); - size_t len = nni_msg_len(msg); - nni_time now = nni_clock(); - int rv; + surv0_ctx * ctx = arg; + surv0_sock * sock = ctx->sock; + surv0_pipe * pipe; + nni_msg * msg = nni_aio_get_msg(aio); + size_t len = nni_msg_len(msg); + nni_time now = nni_clock(); + nng_duration survey_time; + int rv; if (nni_aio_begin(aio) != 0) { return; } + survey_time = nni_atomic_get(&ctx->survey_time); + nni_mtx_lock(&sock->mtx); - // Abort any pending receives -- this is the same as cancellation. - nni_msgq_set_get_error(ctx->rq, NNG_ECANCELED); - nni_msgq_flush(ctx->rq); + // Abort everything outstanding. + surv0_ctx_abort(ctx, NNG_ECANCELED); + nni_timer_cancel(&ctx->timer); - // New survey id will be generated, so unregister the old one. - if (ctx->survid) { - nni_idhash_remove(sock->surveys, ctx->survid); - ctx->survid = 0; - } // Allocate the new ID. - if ((rv = nni_idhash_alloc(sock->surveys, &ctx->survid, ctx)) != 0) { + if ((rv = nni_idhash_alloc(sock->surveys, &ctx->survey_id, ctx)) != 0) { nni_mtx_unlock(&sock->mtx); nni_aio_finish_error(aio, rv); return; } nni_msg_header_clear(msg); - nni_msg_header_must_append_u32(msg, (uint32_t) ctx->survid); + nni_msg_header_must_append_u32(msg, (uint32_t) ctx->survey_id); // From this point, we're committed to success. Note that we send // regardless of whether there are any pipes or not. If no pipes, @@ -170,18 +247,21 @@ surv0_ctx_send(void *arg, nni_aio *aio) nni_aio_set_msg(aio, NULL); NNI_LIST_FOREACH (&sock->pipes, pipe) { - nni_msg_clone(msg); - if (nni_msgq_tryput(pipe->sendq, msg) != 0) { - nni_msg_free(msg); + // if the pipe isn't busy, then send this message direct. + if (!pipe->busy) { + pipe->busy = true; + nni_msg_clone(msg); + nni_aio_set_msg(pipe->aio_send, msg); + nni_pipe_send(pipe->pipe, pipe->aio_send); + } else if (!nni_lmq_full(&pipe->send_queue)) { + nni_msg_clone(msg); + nni_lmq_putq(&pipe->send_queue, msg); } } - ctx->expire = now + ctx->survtime; + ctx->expire = now + survey_time; nni_timer_schedule(&ctx->timer, ctx->expire); - // Allow recv to run. - nni_msgq_set_get_error(ctx->rq, 0); - nni_mtx_unlock(&sock->mtx); nni_msg_free(msg); @@ -196,23 +276,32 @@ surv0_sock_fini(void *arg) surv0_ctx_fini(&sock->ctx); nni_idhash_fini(sock->surveys); nni_pollable_fini(&sock->writable); + nni_pollable_fini(&sock->readable); nni_mtx_fini(&sock->mtx); } static int -surv0_sock_init(void *arg, nni_sock *nsock) +surv0_sock_init(void *arg, nni_sock *s) { surv0_sock *sock = arg; int rv; - NNI_ARG_UNUSED(nsock); + NNI_ARG_UNUSED(s); NNI_LIST_INIT(&sock->pipes, surv0_pipe, node); nni_mtx_init(&sock->mtx); + nni_pollable_init(&sock->readable); nni_pollable_init(&sock->writable); // We are always writable. nni_pollable_raise(&sock->writable); + // We allow for some buffering on a per pipe basis, to allow for + // multiple contexts to have surveys outstanding. It is recommended + // to increase this if many contexts will want to publish + // at nearly the same time. + nni_atomic_init(&sock->send_buf); + nni_atomic_set(&sock->send_buf, 8); + if (((rv = nni_idhash_init(&sock->surveys)) != 0) || ((rv = surv0_ctx_init(&sock->ctx, sock)) != 0)) { surv0_sock_fini(sock); @@ -225,7 +314,6 @@ surv0_sock_init(void *arg, nni_sock *nsock) nni_idhash_set_limits(sock->surveys, 0x80000000u, 0xffffffffu, nni_random() | 0x80000000u); - sock->ctx.survtime = NNI_SECOND; sock->ttl = 8; return (0); @@ -242,7 +330,7 @@ surv0_sock_close(void *arg) { surv0_sock *s = arg; - nni_msgq_close(s->ctx.rq); + surv0_ctx_close(&s->ctx); } static void @@ -250,7 +338,6 @@ surv0_pipe_stop(void *arg) { surv0_pipe *p = arg; - nni_aio_stop(p->aio_getq); nni_aio_stop(p->aio_send); nni_aio_stop(p->aio_recv); } @@ -260,32 +347,33 @@ surv0_pipe_fini(void *arg) { surv0_pipe *p = arg; - nni_aio_free(p->aio_getq); nni_aio_free(p->aio_send); nni_aio_free(p->aio_recv); - nni_msgq_fini(p->sendq); + nni_lmq_fini(&p->send_queue); } static int -surv0_pipe_init(void *arg, nni_pipe *npipe, void *s) +surv0_pipe_init(void *arg, nni_pipe *pipe, void *s) { - surv0_pipe *p = arg; + surv0_pipe *p = arg; + surv0_sock *sock = s; int rv; + int len; + + len = nni_atomic_get(&sock->send_buf); // This depth could be tunable. The deeper the queue, the more - // concurrent surveys that can be delivered. Having said that, this - // is best effort, and a deep queue doesn't really do much for us. + // concurrent surveys that can be delivered (multiple contexts). // Note that surveys can be *outstanding*, but not yet put on the wire. - if (((rv = nni_msgq_init(&p->sendq, 16)) != 0) || - ((rv = nni_aio_alloc(&p->aio_getq, surv0_pipe_getq_cb, p)) != 0) || + if (((rv = nni_lmq_init(&p->send_queue, len)) != 0) || ((rv = nni_aio_alloc(&p->aio_send, surv0_pipe_send_cb, p)) != 0) || ((rv = nni_aio_alloc(&p->aio_recv, surv0_pipe_recv_cb, p)) != 0)) { surv0_pipe_fini(p); return (rv); } - p->npipe = npipe; - p->sock = s; + p->pipe = pipe; + p->sock = sock; return (0); } @@ -295,7 +383,7 @@ surv0_pipe_start(void *arg) surv0_pipe *p = arg; surv0_sock *s = p->sock; - if (nni_pipe_peer(p->npipe) != NNG_SURVEYOR0_PEER) { + if (nni_pipe_peer(p->pipe) != NNG_SURVEYOR0_PEER) { return (NNG_EPROTO); } @@ -303,8 +391,7 @@ surv0_pipe_start(void *arg) nni_list_append(&s->pipes, p); nni_mtx_unlock(&s->mtx); - nni_msgq_aio_get(p->sendq, p->aio_getq); - nni_pipe_recv(p->npipe, p->aio_recv); + nni_pipe_recv(p->pipe, p->aio_recv); return (0); } @@ -314,13 +401,12 @@ surv0_pipe_close(void *arg) surv0_pipe *p = arg; surv0_sock *s = p->sock; - nni_aio_close(p->aio_getq); nni_aio_close(p->aio_send); nni_aio_close(p->aio_recv); - nni_msgq_close(p->sendq); - nni_mtx_lock(&s->mtx); + p->closed = true; + nni_lmq_flush(&p->send_queue); if (nni_list_active(&s->pipes, p)) { nni_list_remove(&s->pipes, p); } @@ -328,34 +414,31 @@ surv0_pipe_close(void *arg) } static void -surv0_pipe_getq_cb(void *arg) -{ - surv0_pipe *p = arg; - - if (nni_aio_result(p->aio_getq) != 0) { - nni_pipe_close(p->npipe); - return; - } - - nni_aio_set_msg(p->aio_send, nni_aio_get_msg(p->aio_getq)); - nni_aio_set_msg(p->aio_getq, NULL); - - nni_pipe_send(p->npipe, p->aio_send); -} - -static void surv0_pipe_send_cb(void *arg) { - surv0_pipe *p = arg; + surv0_pipe *p = arg; + surv0_sock *sock = p->sock; + nni_msg * msg; if (nni_aio_result(p->aio_send) != 0) { nni_msg_free(nni_aio_get_msg(p->aio_send)); nni_aio_set_msg(p->aio_send, NULL); - nni_pipe_close(p->npipe); + nni_pipe_close(p->pipe); return; } - nni_msgq_aio_get(p->sendq, p->aio_getq); + nni_mtx_lock(&sock->mtx); + if (p->closed) { + nni_mtx_unlock(&sock->mtx); + return; + } + if (nni_lmq_getq(&p->send_queue, &msg) == 0) { + nni_aio_set_msg(p->aio_send, msg); + nni_pipe_send(p->pipe, p->aio_send); + } else { + p->busy = false; + } + nni_mtx_unlock(&sock->mtx); } static void @@ -366,85 +449,99 @@ surv0_pipe_recv_cb(void *arg) surv0_ctx * ctx; nni_msg * msg; uint32_t id; + nni_aio *aio; if (nni_aio_result(p->aio_recv) != 0) { - nni_pipe_close(p->npipe); + nni_pipe_close(p->pipe); return; } msg = nni_aio_get_msg(p->aio_recv); nni_aio_set_msg(p->aio_recv, NULL); - nni_msg_set_pipe(msg, nni_pipe_id(p->npipe)); + nni_msg_set_pipe(msg, nni_pipe_id(p->pipe)); // We yank 4 bytes of body, and move them to the header. if (nni_msg_len(msg) < 4) { // Peer sent us garbage. Kick it. nni_msg_free(msg); - nni_pipe_close(p->npipe); + nni_pipe_close(p->pipe); return; } id = nni_msg_trim_u32(msg); - nni_msg_header_must_append_u32(msg ,id); + nni_msg_header_must_append_u32(msg, id); nni_mtx_lock(&sock->mtx); - // Best effort at delivery. Discard if no context or context is // unable to receive it. if ((nni_idhash_find(sock->surveys, id, (void **) &ctx) != 0) || - (nni_msgq_tryput(ctx->rq, msg) != 0)) { + (nni_lmq_full(&ctx->recv_lmq))) { nni_msg_free(msg); + } else if ((aio = nni_list_first(&ctx->recv_queue)) != NULL) { + nni_list_remove(&ctx->recv_queue, aio); + nni_aio_finish_msg(aio, msg); + } else { + nni_lmq_putq(&ctx->recv_lmq, msg); + if (ctx == &sock->ctx) { + nni_pollable_raise(&sock->readable); + } } - nni_mtx_unlock(&sock->mtx); - nni_pipe_recv(p->npipe, p->aio_recv); + nni_pipe_recv(p->pipe, p->aio_recv); } static int -surv0_ctx_set_surveytime(void *arg, const void *buf, size_t sz, nni_opt_type t) +surv0_ctx_set_survey_time( + void *arg, const void *buf, size_t sz, nni_opt_type t) { - surv0_ctx *ctx = arg; - return (nni_copyin_ms(&ctx->survtime, buf, sz, t)); + surv0_ctx * ctx = arg; + nng_duration expire; + int rv; + if ((rv = nni_copyin_ms(&expire, buf, sz, t)) == 0) { + nni_atomic_set(&ctx->survey_time, expire); + } + return (rv); } static int -surv0_ctx_get_surveytime(void *arg, void *buf, size_t *szp, nni_opt_type t) +surv0_ctx_get_survey_time(void *arg, void *buf, size_t *szp, nni_opt_type t) { surv0_ctx *ctx = arg; - return (nni_copyout_ms(ctx->survtime, buf, szp, t)); + return ( + nni_copyout_ms(nni_atomic_get(&ctx->survey_time), buf, szp, t)); } static int -surv0_sock_set_maxttl(void *arg, const void *buf, size_t sz, nni_opt_type t) +surv0_sock_set_max_ttl(void *arg, const void *buf, size_t sz, nni_opt_type t) { surv0_sock *s = arg; return (nni_copyin_int(&s->ttl, buf, sz, 1, NNI_MAX_MAX_TTL, t)); } static int -surv0_sock_get_maxttl(void *arg, void *buf, size_t *szp, nni_opt_type t) +surv0_sock_get_max_ttl(void *arg, void *buf, size_t *szp, nni_opt_type t) { surv0_sock *s = arg; return (nni_copyout_int(s->ttl, buf, szp, t)); } static int -surv0_sock_set_surveytime( +surv0_sock_set_survey_time( void *arg, const void *buf, size_t sz, nni_opt_type t) { surv0_sock *s = arg; - return (surv0_ctx_set_surveytime(&s->ctx, buf, sz, t)); + return (surv0_ctx_set_survey_time(&s->ctx, buf, sz, t)); } static int -surv0_sock_get_surveytime(void *arg, void *buf, size_t *szp, nni_opt_type t) +surv0_sock_get_survey_time(void *arg, void *buf, size_t *szp, nni_opt_type t) { surv0_sock *s = arg; - return (surv0_ctx_get_surveytime(&s->ctx, buf, szp, t)); + return (surv0_ctx_get_survey_time(&s->ctx, buf, szp, t)); } static int -surv0_sock_get_sendfd(void *arg, void *buf, size_t *szp, nni_opt_type t) +surv0_sock_get_send_fd(void *arg, void *buf, size_t *szp, nni_opt_type t) { surv0_sock *sock = arg; int rv; @@ -457,15 +554,13 @@ surv0_sock_get_sendfd(void *arg, void *buf, size_t *szp, nni_opt_type t) } static int -surv0_sock_get_recvfd(void *arg, void *buf, size_t *szp, nni_opt_type t) +surv0_sock_get_recv_fd(void *arg, void *buf, size_t *szp, nni_opt_type t) { surv0_sock * sock = arg; - nni_pollable *readable; int rv; int fd; - if (((rv = nni_msgq_get_recvable(sock->ctx.rq, &readable)) != 0) || - ((rv = nni_pollable_getfd(readable, &fd)) != 0)) { + if ((rv = nni_pollable_getfd(&sock->readable, &fd)) != 0) { return (rv); } return (nni_copyout_int(fd, buf, szp, t)); @@ -497,8 +592,8 @@ static nni_proto_pipe_ops surv0_pipe_ops = { static nni_option surv0_ctx_options[] = { { .o_name = NNG_OPT_SURVEYOR_SURVEYTIME, - .o_get = surv0_ctx_get_surveytime, - .o_set = surv0_ctx_set_surveytime, + .o_get = surv0_ctx_get_survey_time, + .o_set = surv0_ctx_set_survey_time, }, { .o_name = NULL, @@ -516,21 +611,21 @@ static nni_proto_ctx_ops surv0_ctx_ops = { static nni_option surv0_sock_options[] = { { .o_name = NNG_OPT_SURVEYOR_SURVEYTIME, - .o_get = surv0_sock_get_surveytime, - .o_set = surv0_sock_set_surveytime, + .o_get = surv0_sock_get_survey_time, + .o_set = surv0_sock_set_survey_time, }, { .o_name = NNG_OPT_MAXTTL, - .o_get = surv0_sock_get_maxttl, - .o_set = surv0_sock_set_maxttl, + .o_get = surv0_sock_get_max_ttl, + .o_set = surv0_sock_set_max_ttl, }, { .o_name = NNG_OPT_RECVFD, - .o_get = surv0_sock_get_recvfd, + .o_get = surv0_sock_get_recv_fd, }, { .o_name = NNG_OPT_SENDFD, - .o_get = surv0_sock_get_sendfd, + .o_get = surv0_sock_get_send_fd, }, // terminate list { @@ -560,7 +655,7 @@ static nni_proto surv0_proto = { }; int -nng_surveyor0_open(nng_socket *sidp) +nng_surveyor0_open(nng_socket *sock) { - return (nni_proto_open(sidp, &surv0_proto)); + return (nni_proto_open(sock, &surv0_proto)); } |
