aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2016-12-25 11:18:27 -0800
committerGarrett D'Amore <garrett@damore.org>2016-12-25 11:18:27 -0800
commit64de60d98e8e4a896f9d13e4aa70343f329d88b4 (patch)
tree7e1ce1cf40ff6f53f518b26c87db0f93f2e8c841 /src/core
parent2cf6c5b96de05ca3870495f615b23e1fcdd3c4ca (diff)
downloadnng-64de60d98e8e4a896f9d13e4aa70343f329d88b4.tar.gz
nng-64de60d98e8e4a896f9d13e4aa70343f329d88b4.tar.bz2
nng-64de60d98e8e4a896f9d13e4aa70343f329d88b4.zip
Change entry points in transports to bind() and connect().
This was done as these entry points are more clearly associated with single function transport routines like those from BSD sockets, unlike our higher level dial() and listen() APIs that do accept() or reconnect in loops.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/endpt.c6
-rw-r--r--src/core/transport.h8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/core/endpt.c b/src/core/endpt.c
index c5e479a2..1c5f4db5 100644
--- a/src/core/endpt.c
+++ b/src/core/endpt.c
@@ -106,12 +106,12 @@ nni_endpt_close(nni_endpt *ep)
int
-nni_endpt_listen(nni_endpt *ep)
+nni_endpt_bind(nni_endpt *ep)
{
if (ep->ep_close) {
return (NNG_ECLOSED);
}
- return (ep->ep_ops.ep_listen(ep->ep_data));
+ return (ep->ep_ops.ep_bind(ep->ep_data));
}
@@ -132,7 +132,7 @@ nni_dial_once(nni_endpt *ep)
if ((rv = nni_pipe_create(&pipe, ep->ep_ops.ep_pipe_ops)) != 0) {
return (rv);
}
- if ((rv = ep->ep_ops.ep_dial(ep->ep_data, &pipe->p_data)) != 0) {
+ if ((rv = ep->ep_ops.ep_connect(ep->ep_data, &pipe->p_data)) != 0) {
nni_pipe_destroy(pipe);
return (rv);
}
diff --git a/src/core/transport.h b/src/core/transport.h
index e4f07002..c0bade07 100644
--- a/src/core/transport.h
+++ b/src/core/transport.h
@@ -44,18 +44,18 @@ struct nni_endpt_ops {
// The endpoint will already have been closed.
void (*ep_destroy)(void *);
- // ep_dial starts dialing, and creates a new pipe,
+ // ep_connect establishes a connection, and creates a new pipe,
// which is returned in the final argument. It can return errors
// NNG_EACCESS, NNG_ECONNREFUSED, NNG_EBADADDR, NNG_ECONNFAILED,
// NNG_ETIMEDOUT, and NNG_EPROTO.
- int (*ep_dial)(void *, void **);
+ int (*ep_connect)(void *, void **);
- // ep_listen just does the bind() and listen() work,
+ // ep_bind just does the bind() and listen() work,
// reserving the address but not creating any connections.
// It should return NNG_EADDRINUSE if the address is already
// taken. It can also return NNG_EBADADDR for an unsuitable
// address, or NNG_EACCESS for permission problems.
- int (*ep_listen)(void *);
+ int (*ep_bind)(void *);
// ep_accept accepts an inbound connection, and creates
// a transport pipe, which is returned in the final argument.