aboutsummaryrefslogtreecommitdiff
path: root/src/sp/transport/tcp
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-11-18 01:17:24 -0800
committerGarrett D'Amore <garrett@damore.org>2024-11-18 08:33:05 -0800
commitca6cfe359fa55a5a7f4b6ae73500ffd98e6ee968 (patch)
treed69a9af2e88c9bf5bc0d565bdd2ea975f2723d52 /src/sp/transport/tcp
parente54e2b1a98abfdb75232a9b3218714ce34c9a34f (diff)
downloadnng-ca6cfe359fa55a5a7f4b6ae73500ffd98e6ee968.tar.gz
nng-ca6cfe359fa55a5a7f4b6ae73500ffd98e6ee968.tar.bz2
nng-ca6cfe359fa55a5a7f4b6ae73500ffd98e6ee968.zip
URL refactor part 1.
This eliminates most (but not all) of the dynamic allocations associated with URL objects. A number of convenience fields on the URL are removed, but we are able to use common buffer for most of the details.
Diffstat (limited to 'src/sp/transport/tcp')
-rw-r--r--src/sp/transport/tcp/tcp_test.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/sp/transport/tcp/tcp_test.c b/src/sp/transport/tcp/tcp_test.c
index 57c612b7..c80a259f 100644
--- a/src/sp/transport/tcp/tcp_test.c
+++ b/src/sp/transport/tcp/tcp_test.c
@@ -10,6 +10,7 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include "nng/nng.h"
#include <nuts.h>
// TCP tests.
@@ -30,19 +31,9 @@ void
test_tcp_wild_card_bind(void)
{
nng_socket s1;
- nng_socket s2;
- char addr[NNG_MAXADDRLEN];
- uint16_t port;
-
- port = nuts_next_port();
NUTS_OPEN(s1);
- NUTS_OPEN(s2);
- (void) snprintf(addr, sizeof(addr), "tcp4://*:%u", port);
- NUTS_PASS(nng_listen(s1, addr, NULL, 0));
- (void) snprintf(addr, sizeof(addr), "tcp://127.0.0.1:%u", port);
- NUTS_PASS(nng_dial(s2, addr, NULL, 0));
- NUTS_CLOSE(s2);
+ NUTS_FAIL(nng_listen(s1, "tcp4://*:8080", NULL, 0), NNG_EADDRINVAL);
NUTS_CLOSE(s1);
}