aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/platform/posix/posix_aio.h3
-rw-r--r--src/platform/posix/posix_pollq.h8
-rw-r--r--src/platform/posix/posix_pollq_epoll.h6
-rw-r--r--src/platform/posix/posix_pollq_kqueue.h7
-rw-r--r--src/platform/posix/posix_pollq_port.h7
-rw-r--r--src/platform/posix/posix_pollq_select.h7
-rw-r--r--src/platform/posix/posix_resolv_gai.c2
-rw-r--r--src/platform/posix/posix_sockaddr.c2
-rw-r--r--src/platform/posix/posix_tcp.h6
-rw-r--r--src/platform/posix/posix_tcpconn.c11
-rw-r--r--src/platform/posix/posix_tcpdial.c16
-rw-r--r--src/platform/posix/posix_tcplisten.c14
-rw-r--r--src/platform/posix/posix_udp.c2
-rw-r--r--src/platform/tcp_stream_test.c5
-rw-r--r--src/platform/windows/win_tcplisten.c2
-rw-r--r--src/sp/transport/dtls/dtls.c2
-rw-r--r--src/sp/transport/tcp/tcp.c2
-rw-r--r--src/sp/transport/tls/tls.c2
-rw-r--r--src/sp/transport/udp/udp.c2
-rw-r--r--src/sp/transport/udp/udp_tran_test.c2
-rw-r--r--src/sp/transport/ws/websocket.c2
-rw-r--r--src/sp/transport/ws/ws_test.c12
-rw-r--r--src/supplemental/http/http_server.c2
-rw-r--r--src/supplemental/tls/tls_test.c18
-rw-r--r--src/supplemental/websocket/wssfile_test.c8
-rw-r--r--src/testing/marry.c2
26 files changed, 89 insertions, 63 deletions
diff --git a/src/platform/posix/posix_aio.h b/src/platform/posix/posix_aio.h
index 3b1ce751..67b60a12 100644
--- a/src/platform/posix/posix_aio.h
+++ b/src/platform/posix/posix_aio.h
@@ -1,5 +1,5 @@
//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -17,7 +17,6 @@
// that is not very performant on many systems. So we emulate this using
// one of several possible different backends.
-#include "core/nng_impl.h"
#include "posix_pollq.h"
#include <sys/stat.h> // needed for musl build
diff --git a/src/platform/posix/posix_pollq.h b/src/platform/posix/posix_pollq.h
index a6306643..a1b5f605 100644
--- a/src/platform/posix/posix_pollq.h
+++ b/src/platform/posix/posix_pollq.h
@@ -1,5 +1,5 @@
//
-// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -19,10 +19,8 @@
// that is not very performant on many systems. So we emulate this using
// one of several possible different backends.
-#include "core/nng_impl.h"
-
-typedef struct nni_posix_pfd nni_posix_pfd;
-typedef void (*nni_posix_pfd_cb)(void *, unsigned);
+// #include "core/nng_impl.h"
+#include "../../core/defs.h"
#if defined(NNG_POLLQ_KQUEUE)
#include "posix_pollq_kqueue.h"
diff --git a/src/platform/posix/posix_pollq_epoll.h b/src/platform/posix/posix_pollq_epoll.h
index a6ef5ad8..05755c52 100644
--- a/src/platform/posix/posix_pollq_epoll.h
+++ b/src/platform/posix/posix_pollq_epoll.h
@@ -13,6 +13,12 @@
#include <poll.h>
+#include "../../core/list.h"
+#include "../../core/platform.h"
+
+typedef struct nni_posix_pfd nni_posix_pfd;
+typedef void (*nni_posix_pfd_cb)(void *, unsigned);
+
// nni_posix_pfd is the handle used by the poller. It's internals are private
// to the poller.
struct nni_posix_pfd {
diff --git a/src/platform/posix/posix_pollq_kqueue.h b/src/platform/posix/posix_pollq_kqueue.h
index 69cf6dae..3959b5e6 100644
--- a/src/platform/posix/posix_pollq_kqueue.h
+++ b/src/platform/posix/posix_pollq_kqueue.h
@@ -11,6 +11,13 @@
#ifndef PLATFORM_POSIX_POLLQ_KQUEUE_H
#define PLATFORM_POSIX_POLLQ_KQUEUE_H
+#include "../../core/defs.h"
+#include "../../core/list.h"
+#include "../../core/platform.h"
+
+typedef struct nni_posix_pfd nni_posix_pfd;
+typedef void (*nni_posix_pfd_cb)(void *, unsigned);
+
// nni_posix_pfd is the handle used by the poller. It's internals are private
// to the poller.
struct nni_posix_pfd {
diff --git a/src/platform/posix/posix_pollq_port.h b/src/platform/posix/posix_pollq_port.h
index d8771527..377e3620 100644
--- a/src/platform/posix/posix_pollq_port.h
+++ b/src/platform/posix/posix_pollq_port.h
@@ -1,5 +1,5 @@
//
-// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -13,6 +13,11 @@
#include <poll.h>
+#include "../../core/platform.h"
+
+typedef struct nni_posix_pfd nni_posix_pfd;
+typedef void (*nni_posix_pfd_cb)(void *, unsigned);
+
typedef struct nni_posix_pollq nni_posix_pollq;
// nni_posix_pfd is the handle used by the poller. It's internals are private
diff --git a/src/platform/posix/posix_pollq_select.h b/src/platform/posix/posix_pollq_select.h
index 012f10a0..4f59c007 100644
--- a/src/platform/posix/posix_pollq_select.h
+++ b/src/platform/posix/posix_pollq_select.h
@@ -1,5 +1,5 @@
//
-// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -11,6 +11,11 @@
#ifndef PLATFORM_POSIX_POLLQ_SELECT_H
#define PLATFORM_POSIX_POLLQ_SELECT_H
+#include "../../core/platform.h"
+
+typedef struct nni_posix_pfd nni_posix_pfd;
+typedef void (*nni_posix_pfd_cb)(void *, unsigned);
+
// nni_posix_pfd is the handle used by the poller. It's internals are private
// to the poller.
struct nni_posix_pfd {
diff --git a/src/platform/posix/posix_resolv_gai.c b/src/platform/posix/posix_resolv_gai.c
index fe6ee2d7..3696cef1 100644
--- a/src/platform/posix/posix_resolv_gai.c
+++ b/src/platform/posix/posix_resolv_gai.c
@@ -37,7 +37,7 @@
#endif
#ifndef NNG_HAVE_INET6
-#ifdef HAVE_NNG_HAVE_INET6_BSD
+#ifdef NNG_HAVE_INET6_BSD
#define NNG_HAVE_INET6
#include <netinet6/in6.h>
#else
diff --git a/src/platform/posix/posix_sockaddr.c b/src/platform/posix/posix_sockaddr.c
index c86b6fb5..29d8b8f4 100644
--- a/src/platform/posix/posix_sockaddr.c
+++ b/src/platform/posix/posix_sockaddr.c
@@ -23,7 +23,7 @@
#include <sys/un.h>
#ifndef NNG_HAVE_INET6
-#ifdef HAVE_NNG_HAVE_INET6_BSD
+#ifdef NNG_HAVE_INET6_BSD
#define NNG_HAVE_INET6
#include <netinet6/in6.h>
#else
diff --git a/src/platform/posix/posix_tcp.h b/src/platform/posix/posix_tcp.h
index 20325841..d8743063 100644
--- a/src/platform/posix/posix_tcp.h
+++ b/src/platform/posix/posix_tcp.h
@@ -12,9 +12,11 @@
#ifndef PLATFORM_POSIX_TCP_H
#define PLATFORM_POSIX_TCP_H
-#include "core/nng_impl.h"
+#include "../../core/defs.h"
+#include "../../core/reap.h"
+#include "../../core/stream.h"
-#include "platform/posix/posix_aio.h"
+#include "posix_aio.h"
struct nni_tcp_conn {
nng_stream stream;
diff --git a/src/platform/posix/posix_tcpconn.c b/src/platform/posix/posix_tcpconn.c
index c04c27c1..833cd560 100644
--- a/src/platform/posix/posix_tcpconn.c
+++ b/src/platform/posix/posix_tcpconn.c
@@ -1,5 +1,5 @@
//
-// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
// Copyright 2019 Devolutions <info@devolutions.net>
//
@@ -9,9 +9,6 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "core/nng_impl.h"
-#include "platform/posix/posix_pollq.h"
-
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
@@ -26,6 +23,12 @@
#define MSG_NOSIGNAL 0
#endif
+#include "../../core/aio.h"
+#include "../../core/defs.h"
+#include "../../core/options.h"
+#include "../../core/platform.h"
+
+#include "posix_pollq.h"
#include "posix_tcp.h"
static void
diff --git a/src/platform/posix/posix_tcpdial.c b/src/platform/posix/posix_tcpdial.c
index 181a667f..12fa990f 100644
--- a/src/platform/posix/posix_tcpdial.c
+++ b/src/platform/posix/posix_tcpdial.c
@@ -1,5 +1,5 @@
//
-// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
// Copyright 2018 Devolutions <info@devolutions.net>
//
@@ -9,8 +9,6 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "core/nng_impl.h"
-
#include <errno.h>
#include <netinet/in.h>
#include <string.h>
@@ -21,10 +19,8 @@
#define SOCK_CLOEXEC 0
#endif
-#include "posix_tcp.h"
-
#ifndef NNG_HAVE_INET6
-#ifdef HAVE_NNG_HAVE_INET6_BSD
+#ifdef NNG_HAVE_INET6_BSD
#define NNG_HAVE_INET6
#include <netinet6/in6.h>
#else
@@ -32,6 +28,14 @@
#endif
#endif
+#include "../../core/aio.h"
+#include "../../core/defs.h"
+#include "../../core/options.h"
+#include "../../core/platform.h"
+#include "../../core/refcnt.h"
+
+#include "posix_tcp.h"
+
struct nni_tcp_dialer {
nni_list connq; // pending connections
bool closed;
diff --git a/src/platform/posix/posix_tcplisten.c b/src/platform/posix/posix_tcplisten.c
index 700af4c5..b158508c 100644
--- a/src/platform/posix/posix_tcplisten.c
+++ b/src/platform/posix/posix_tcplisten.c
@@ -9,9 +9,6 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "core/nng_impl.h"
-#include "nng/nng.h"
-
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
@@ -29,7 +26,7 @@
#endif
#ifndef NNG_HAVE_INET6
-#ifdef HAVE_NNG_HAVE_INET6_BSD
+#ifdef NNG_HAVE_INET6_BSD
#define NNG_HAVE_INET6
#include <netinet6/in6.h>
#else
@@ -37,6 +34,13 @@
#endif
#endif
+#include "../../core/aio.h"
+#include "../../core/defs.h"
+#include "../../core/list.h"
+#include "../../core/options.h"
+#include "../../core/platform.h"
+#include "../../core/url.h"
+
#include "posix_tcp.h"
typedef struct tcp_listener {
@@ -480,7 +484,7 @@ static const nni_option tcp_listener_options[] = {
.o_get = tcp_listener_get_keepalive,
},
{
- .o_name = NNG_OPT_TCP_BOUND_PORT,
+ .o_name = NNG_OPT_BOUND_PORT,
.o_get = tcp_listener_get_port,
},
{
diff --git a/src/platform/posix/posix_udp.c b/src/platform/posix/posix_udp.c
index 99460721..7188b427 100644
--- a/src/platform/posix/posix_udp.c
+++ b/src/platform/posix/posix_udp.c
@@ -32,7 +32,7 @@
#endif
#ifndef NNG_HAVE_INET6
-#ifdef HAVE_NNG_HAVE_INET6_BSD
+#ifdef NNG_HAVE_INET6_BSD
#define NNG_HAVE_INET6
#include <netinet6/in6.h>
#else
diff --git a/src/platform/tcp_stream_test.c b/src/platform/tcp_stream_test.c
index 1ed415c7..a0943e6c 100644
--- a/src/platform/tcp_stream_test.c
+++ b/src/platform/tcp_stream_test.c
@@ -164,7 +164,7 @@ test_tcp_listen_port_zero_not_bound(void)
// start a listening stream listener but do not call accept
NUTS_PASS(nng_stream_listener_alloc(&l, addr));
- NUTS_FAIL(nng_stream_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &p),
+ NUTS_FAIL(nng_stream_listener_get_int(l, NNG_OPT_BOUND_PORT, &p),
NNG_ESTATE);
nng_stream_listener_free(l);
}
@@ -204,8 +204,7 @@ test_tcp_listen_activation(void)
NUTS_PASS(nng_stream_listener_alloc(&l1, addr));
NUTS_PASS(nng_stream_listener_listen(l1));
- NUTS_PASS(
- nng_stream_listener_get_int(l1, NNG_OPT_TCP_BOUND_PORT, &port));
+ NUTS_PASS(nng_stream_listener_get_int(l1, NNG_OPT_BOUND_PORT, &port));
snprintf(url, sizeof(url), "tcp4://127.0.0.1:%u", port);
NUTS_PASS(nng_stream_dialer_alloc(&d, url));
diff --git a/src/platform/windows/win_tcplisten.c b/src/platform/windows/win_tcplisten.c
index 0b11104d..b32c1fbb 100644
--- a/src/platform/windows/win_tcplisten.c
+++ b/src/platform/windows/win_tcplisten.c
@@ -517,7 +517,7 @@ static const nni_option tcp_listener_options[] = {
.o_get = tcp_listener_get_keepalive,
},
{
- .o_name = NNG_OPT_TCP_BOUND_PORT,
+ .o_name = NNG_OPT_BOUND_PORT,
.o_get = tcp_listener_get_port,
},
{
diff --git a/src/sp/transport/dtls/dtls.c b/src/sp/transport/dtls/dtls.c
index ff78709d..5a97af4f 100644
--- a/src/sp/transport/dtls/dtls.c
+++ b/src/sp/transport/dtls/dtls.c
@@ -1726,7 +1726,7 @@ static const nni_option dtls_ep_opts[] = {
.o_get = dtls_ep_get_remaddr,
},
{
- .o_name = NNG_OPT_TCP_BOUND_PORT,
+ .o_name = NNG_OPT_BOUND_PORT,
.o_get = dtls_ep_get_port,
},
// terminate list
diff --git a/src/sp/transport/tcp/tcp.c b/src/sp/transport/tcp/tcp.c
index 1040e7a9..759bc320 100644
--- a/src/sp/transport/tcp/tcp.c
+++ b/src/sp/transport/tcp/tcp.c
@@ -938,7 +938,7 @@ tcptran_ep_bind(void *arg, nng_url *url)
if (rv == NNG_OK) {
int port;
nng_stream_listener_get_int(
- ep->listener, NNG_OPT_TCP_BOUND_PORT, &port);
+ ep->listener, NNG_OPT_BOUND_PORT, &port);
url->u_port = (uint32_t) port;
}
nni_mtx_unlock(&ep->mtx);
diff --git a/src/sp/transport/tls/tls.c b/src/sp/transport/tls/tls.c
index 4814b29f..5086a942 100644
--- a/src/sp/transport/tls/tls.c
+++ b/src/sp/transport/tls/tls.c
@@ -877,7 +877,7 @@ tlstran_ep_bind(void *arg, nng_url *url)
if (rv == NNG_OK) {
int port;
nng_stream_listener_get_int(
- ep->listener, NNG_OPT_TCP_BOUND_PORT, &port);
+ ep->listener, NNG_OPT_BOUND_PORT, &port);
url->u_port = (uint32_t) port;
}
nni_mtx_unlock(&ep->mtx);
diff --git a/src/sp/transport/udp/udp.c b/src/sp/transport/udp/udp.c
index 7f46a3c9..02eb088a 100644
--- a/src/sp/transport/udp/udp.c
+++ b/src/sp/transport/udp/udp.c
@@ -1740,7 +1740,7 @@ static const nni_option udp_ep_opts[] = {
.o_get = udp_ep_get_remaddr,
},
{
- .o_name = NNG_OPT_TCP_BOUND_PORT,
+ .o_name = NNG_OPT_BOUND_PORT,
.o_get = udp_ep_get_port,
},
// terminate list
diff --git a/src/sp/transport/udp/udp_tran_test.c b/src/sp/transport/udp/udp_tran_test.c
index 56a25cce..33517246 100644
--- a/src/sp/transport/udp/udp_tran_test.c
+++ b/src/sp/transport/udp/udp_tran_test.c
@@ -86,7 +86,7 @@ test_udp_port_zero_bind(void)
NUTS_MATCH(nng_url_hostname(u1), nng_url_hostname(u2));
NUTS_MATCH(nng_url_path(u1), nng_url_path(u2));
NUTS_TRUE(nng_url_port(u1) == nng_url_port(u2));
- NUTS_PASS(nng_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &port));
+ NUTS_PASS(nng_listener_get_int(l, NNG_OPT_BOUND_PORT, &port));
NUTS_TRUE(port == (int) nng_url_port(u1));
NUTS_CLOSE(s2);
diff --git a/src/sp/transport/ws/websocket.c b/src/sp/transport/ws/websocket.c
index dec0ea8e..4033553b 100644
--- a/src/sp/transport/ws/websocket.c
+++ b/src/sp/transport/ws/websocket.c
@@ -234,7 +234,7 @@ wstran_listener_bind(void *arg, nng_url *url)
if ((rv = nng_stream_listener_listen(l->listener)) == NNG_OK) {
int port;
nng_stream_listener_get_int(
- l->listener, NNG_OPT_TCP_BOUND_PORT, &port);
+ l->listener, NNG_OPT_BOUND_PORT, &port);
url->u_port = (uint32_t) port;
}
return (rv);
diff --git a/src/sp/transport/ws/ws_test.c b/src/sp/transport/ws/ws_test.c
index 4f41b150..6f41fe99 100644
--- a/src/sp/transport/ws/ws_test.c
+++ b/src/sp/transport/ws/ws_test.c
@@ -24,7 +24,7 @@ test_ws_url_path_filters(void)
snprintf(addr, sizeof(addr), "ws://127.0.0.1:0/ws-url-path-filters");
NUTS_PASS(nng_listen(s1, addr, &l, 0));
- NUTS_PASS(nng_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &port));
+ NUTS_PASS(nng_listener_get_int(l, NNG_OPT_BOUND_PORT, &port));
snprintf(
addr, sizeof(addr), "ws://127.0.0.1:%d/some-other-location", port);
@@ -58,16 +58,16 @@ test_wild_card_port(void)
NUTS_OPEN(s5);
NUTS_OPEN(s6);
NUTS_PASS(nng_listen(s1, "ws://127.0.0.1:0/one", &l1, 0));
- NUTS_PASS(nng_listener_get_int(l1, NNG_OPT_TCP_BOUND_PORT, &port1));
+ NUTS_PASS(nng_listener_get_int(l1, NNG_OPT_BOUND_PORT, &port1));
NUTS_TRUE(port1 != 0);
snprintf(ws_url, sizeof(ws_url), "ws4://127.0.0.1:%d/two", port1);
NUTS_PASS(nng_listen(s2, ws_url, &l2, 0));
- NUTS_PASS(nng_listener_get_int(l2, NNG_OPT_TCP_BOUND_PORT, &port2));
+ NUTS_PASS(nng_listener_get_int(l2, NNG_OPT_BOUND_PORT, &port2));
NUTS_TRUE(port1 != 0);
NUTS_TRUE(port1 == port2);
// Now try a different wild card port.
NUTS_PASS(nng_listen(s3, "ws4://127.0.0.1:0/three", &l3, 0));
- NUTS_PASS(nng_listener_get_int(l3, NNG_OPT_TCP_BOUND_PORT, &port3));
+ NUTS_PASS(nng_listener_get_int(l3, NNG_OPT_BOUND_PORT, &port3));
NUTS_TRUE(port3 != 0);
NUTS_TRUE(port3 != port1);
@@ -127,7 +127,7 @@ test_empty_host(void)
// we use ws4 to ensure 127.0.0.1 binding
snprintf(addr, sizeof(addr), "ws4://:0/test");
NUTS_PASS(nng_listen(s1, addr, &l, 0));
- NUTS_PASS(nng_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &port));
+ NUTS_PASS(nng_listener_get_int(l, NNG_OPT_BOUND_PORT, &port));
nng_msleep(100);
snprintf(addr, sizeof(addr), "ws://127.0.0.1:%u/test", port);
@@ -165,7 +165,7 @@ test_ws_recv_max(void)
NUTS_PASS(nng_listener_get_size(l, NNG_OPT_RECVMAXSZ, &sz));
NUTS_TRUE(sz == 100);
NUTS_PASS(nng_listener_start(l, 0));
- NUTS_PASS(nng_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &port));
+ NUTS_PASS(nng_listener_get_int(l, NNG_OPT_BOUND_PORT, &port));
NUTS_OPEN(s1);
snprintf(url, sizeof(url), addr, port);
diff --git a/src/supplemental/http/http_server.c b/src/supplemental/http/http_server.c
index d1e8a5e7..d24e5bba 100644
--- a/src/supplemental/http/http_server.c
+++ b/src/supplemental/http/http_server.c
@@ -871,7 +871,7 @@ http_server_start(nni_http_server *s)
if (s->port == 0) {
int port;
nng_stream_listener_get_int(
- s->listener, NNG_OPT_TCP_BOUND_PORT, &port);
+ s->listener, NNG_OPT_BOUND_PORT, &port);
s->port = (uint32_t) port;
}
nng_stream_listener_accept(s->listener, &s->accaio);
diff --git a/src/supplemental/tls/tls_test.c b/src/supplemental/tls/tls_test.c
index cbe9c0b9..a9c78ba2 100644
--- a/src/supplemental/tls/tls_test.c
+++ b/src/supplemental/tls/tls_test.c
@@ -100,8 +100,7 @@ test_tls_large_message(void)
c1, nuts_server_crt, nuts_server_key, NULL));
NUTS_PASS(nng_stream_listener_set_tls(l, c1));
NUTS_PASS(nng_stream_listener_listen(l));
- NUTS_PASS(
- nng_stream_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &port));
+ NUTS_PASS(nng_stream_listener_get_int(l, NNG_OPT_BOUND_PORT, &port));
NUTS_TRUE(port > 0);
NUTS_TRUE(port < 65536);
@@ -187,8 +186,7 @@ test_tls_ecdsa(void)
c1, nuts_ecdsa_server_crt, nuts_ecdsa_server_key, NULL));
NUTS_PASS(nng_stream_listener_set_tls(l, c1));
NUTS_PASS(nng_stream_listener_listen(l));
- NUTS_PASS(
- nng_stream_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &port));
+ NUTS_PASS(nng_stream_listener_get_int(l, NNG_OPT_BOUND_PORT, &port));
NUTS_TRUE(port > 0);
NUTS_TRUE(port < 65536);
@@ -274,8 +272,7 @@ test_tls_null_server_name(void)
c1, nuts_server_crt, nuts_server_key, NULL));
NUTS_PASS(nng_stream_listener_set_tls(l, c1));
NUTS_PASS(nng_stream_listener_listen(l));
- NUTS_PASS(
- nng_stream_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &port));
+ NUTS_PASS(nng_stream_listener_get_int(l, NNG_OPT_BOUND_PORT, &port));
NUTS_TRUE(port > 0);
NUTS_TRUE(port < 65536);
@@ -383,8 +380,7 @@ test_tls_psk(void)
NUTS_PASS(nng_tls_config_psk(c1, "identity", key, sizeof(key)));
NUTS_PASS(nng_stream_listener_set_tls(l, c1));
NUTS_PASS(nng_stream_listener_listen(l));
- NUTS_PASS(
- nng_stream_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &port));
+ NUTS_PASS(nng_stream_listener_get_int(l, NNG_OPT_BOUND_PORT, &port));
NUTS_TRUE(port > 0);
NUTS_TRUE(port < 65536);
@@ -477,8 +473,7 @@ test_tls_psk_server_identities(void)
NUTS_PASS(nng_tls_config_psk(c1, identity, key, sizeof(key)));
NUTS_PASS(nng_stream_listener_set_tls(l, c1));
NUTS_PASS(nng_stream_listener_listen(l));
- NUTS_PASS(
- nng_stream_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &port));
+ NUTS_PASS(nng_stream_listener_get_int(l, NNG_OPT_BOUND_PORT, &port));
NUTS_TRUE(port > 0);
NUTS_TRUE(port < 65536);
@@ -567,8 +562,7 @@ test_tls_psk_bad_identity(void)
NUTS_PASS(nng_tls_config_psk(c1, "identity1", key, sizeof(key)));
NUTS_PASS(nng_stream_listener_set_tls(l, c1));
NUTS_PASS(nng_stream_listener_listen(l));
- NUTS_PASS(
- nng_stream_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &port));
+ NUTS_PASS(nng_stream_listener_get_int(l, NNG_OPT_BOUND_PORT, &port));
NUTS_TRUE(port > 0);
NUTS_TRUE(port < 65536);
diff --git a/src/supplemental/websocket/wssfile_test.c b/src/supplemental/websocket/wssfile_test.c
index dde71129..c42290ef 100644
--- a/src/supplemental/websocket/wssfile_test.c
+++ b/src/supplemental/websocket/wssfile_test.c
@@ -81,7 +81,7 @@ test_invalid_verify(void)
NUTS_PASS(nng_listener_create(&l, s1, addr));
init_listener_wss_file(l);
NUTS_PASS(nng_listener_start(l, 0));
- NUTS_PASS(nng_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &port));
+ NUTS_PASS(nng_listener_get_int(l, NNG_OPT_BOUND_PORT, &port));
nng_msleep(100);
@@ -128,7 +128,7 @@ test_no_verify(void)
NUTS_PASS(nng_listener_create(&l, s1, addr));
init_listener_wss_file(l);
NUTS_PASS(nng_listener_start(l, 0));
- NUTS_PASS(nng_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &port));
+ NUTS_PASS(nng_listener_get_int(l, NNG_OPT_BOUND_PORT, &port));
nng_msleep(100);
snprintf(addr, sizeof(addr), "wss://127.0.0.1:%u/test", port);
@@ -178,7 +178,7 @@ test_verify_works(void)
NUTS_PASS(nng_listener_create(&l, s1, addr));
init_listener_wss_file(l);
NUTS_PASS(nng_listener_start(l, 0));
- NUTS_PASS(nng_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &port));
+ NUTS_PASS(nng_listener_get_int(l, NNG_OPT_BOUND_PORT, &port));
// It can take a bit for the listener to start up in clouds.
nng_msleep(200);
@@ -239,7 +239,7 @@ test_tls_config(void)
init_listener_wss_file(l);
NUTS_PASS(nng_listener_start(l, 0));
- NUTS_PASS(nng_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &port));
+ NUTS_PASS(nng_listener_get_int(l, NNG_OPT_BOUND_PORT, &port));
// make sure we cannot change the auth mode while running
diff --git a/src/testing/marry.c b/src/testing/marry.c
index a197fb01..2c5723db 100644
--- a/src/testing/marry.c
+++ b/src/testing/marry.c
@@ -374,7 +374,7 @@ nuts_marry_ex(
if ((strstr(url, ":0") != NULL) &&
// If a TCP port of zero was selected, let's ask for the actual
// port bound.
- (nng_listener_get_int(l, NNG_OPT_TCP_BOUND_PORT, &port) == 0) &&
+ (nng_listener_get_int(l, NNG_OPT_BOUND_PORT, &port) == 0) &&
(port > 0)) {
replace_port_zero(url, addr, port);
url = addr;