From 14c8396d6954622de9e07b010810ee49f0496b2a Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 3 Jul 2017 10:33:14 -0700 Subject: Rename legacy connect/accept as _sync for now. --- src/core/endpt.c | 16 ++++++++-------- src/core/transport.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/core') diff --git a/src/core/endpt.c b/src/core/endpt.c index 223d86a3..b24d7643 100644 --- a/src/core/endpt.c +++ b/src/core/endpt.c @@ -237,7 +237,7 @@ nni_ep_remove(nni_ep *ep) static int -nni_ep_connect(nni_ep *ep) +nni_ep_connect_sync(nni_ep *ep) { nni_pipe *pipe; int rv; @@ -245,7 +245,7 @@ nni_ep_connect(nni_ep *ep) if ((rv = nni_pipe_create(&pipe, ep, ep->ep_sock, ep->ep_tran)) != 0) { return (rv); } - rv = ep->ep_ops.ep_connect(ep->ep_data, &pipe->p_tran_data); + rv = ep->ep_ops.ep_connect_sync(ep->ep_data, &pipe->p_tran_data); if (rv != 0) { nni_pipe_remove(pipe); return (rv); @@ -330,7 +330,7 @@ nni_dialer(void *arg) } nni_mtx_unlock(&ep->ep_mtx); - rv = nni_ep_connect(ep); + rv = nni_ep_connect_sync(ep); switch (rv) { case 0: // good connection @@ -383,7 +383,7 @@ nni_ep_dial(nni_ep *ep, int flags) if (flags & NNG_FLAG_SYNCH) { nni_mtx_unlock(&ep->ep_mtx); - rv = nni_ep_connect(ep); + rv = nni_ep_connect_sync(ep); if (rv != 0) { nni_thr_fini(&ep->ep_thr); ep->ep_mode = NNI_EP_MODE_IDLE; @@ -399,8 +399,8 @@ nni_ep_dial(nni_ep *ep, int flags) } -int -nni_ep_accept(nni_ep *ep) +static int +nni_ep_accept_sync(nni_ep *ep) { nni_pipe *pipe; int rv; @@ -411,7 +411,7 @@ nni_ep_accept(nni_ep *ep) if ((rv = nni_pipe_create(&pipe, ep, ep->ep_sock, ep->ep_tran)) != 0) { return (rv); } - rv = ep->ep_ops.ep_accept(ep->ep_data, &pipe->p_tran_data); + rv = ep->ep_ops.ep_accept_sync(ep->ep_data, &pipe->p_tran_data); if (rv != 0) { nni_pipe_remove(pipe); return (rv); @@ -464,7 +464,7 @@ nni_listener(void *arg) } nni_mtx_unlock(&ep->ep_mtx); - if ((rv = nni_ep_accept(ep)) == 0) { + if ((rv = nni_ep_accept_sync(ep)) == 0) { // Success! Loop around for the next one. continue; } diff --git a/src/core/transport.h b/src/core/transport.h index 383526cb..5a057c93 100644 --- a/src/core/transport.h +++ b/src/core/transport.h @@ -51,7 +51,7 @@ struct nni_tran_ep { // NNG_ETIMEDOUT, and NNG_EPROTO. The first argument is the // transport specific endpoint, and the second is a pointer to // receive a newly created transport-specific pipe structure. - int (*ep_connect)(void *, void **); + int (*ep_connect_sync)(void *, void **); // ep_bind just does the bind() and listen() work, // reserving the address but not creating any connections. @@ -63,7 +63,7 @@ struct nni_tran_ep { // ep_accept accepts an inbound connection. The first argument // is the transport-specific endpoint, and the second is a pointer to // a transport-specific pipe, created by this function. - int (*ep_accept)(void *, void **); + int (*ep_accept_sync)(void *, void **); // ep_close stops the endpoint from operating altogether. It does // not affect pipes that have already been created. -- cgit v1.2.3-70-g09d2