diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/endpt.c | 12 | ||||
| -rw-r--r-- | src/core/endpt.h | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/core/endpt.c b/src/core/endpt.c index e6216ba3..fa30bf77 100644 --- a/src/core/endpt.c +++ b/src/core/endpt.c @@ -605,21 +605,21 @@ nni_ep_setopt(nni_ep *ep, const char *name, const void *val, size_t sz) return (NNG_EREADONLY); } nni_mtx_lock(&ep->ep_mtx); - // XXX: Consider removing this test. - if (ep->ep_started) { - nni_mtx_unlock(&ep->ep_mtx); - return (NNG_ESTATE); - } rv = eo->eo_setopt(ep->ep_data, val, sz); nni_mtx_unlock(&ep->ep_mtx); return (rv); } - // XXX: socket fallback return (NNG_ENOTSUP); } int +nni_ep_mode(nni_ep *ep) +{ + return (ep->ep_mode); +} + +int nni_ep_getopt(nni_ep *ep, const char *name, void *valp, size_t *szp) { nni_tran_ep_option *eo; diff --git a/src/core/endpt.h b/src/core/endpt.h index d12d661f..f5ad09ee 100644 --- a/src/core/endpt.h +++ b/src/core/endpt.h @@ -32,6 +32,7 @@ extern int nni_ep_getopt(nni_ep *, const char *, void *, size_t *); extern int nni_ep_pipe_add(nni_ep *ep, nni_pipe *); extern void nni_ep_pipe_remove(nni_ep *, nni_pipe *); extern const char *nni_ep_url(nni_ep *); +extern int nni_ep_mode(nni_ep *); // Endpoint modes. Currently used by transports. Remove this when we make // transport dialers and listeners explicit. |
