aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-18 18:56:16 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-18 18:56:16 -0800
commite6cded3832c9e92c922d49d824b446ce33fbf120 (patch)
treef1ee4ab169c4e69c69699b2ce5c37bf368fc51e5 /tests
parent8049d822b3d8ea8bd11793369004c638d833964e (diff)
downloadnng-e6cded3832c9e92c922d49d824b446ce33fbf120.tar.gz
nng-e6cded3832c9e92c922d49d824b446ce33fbf120.tar.bz2
nng-e6cded3832c9e92c922d49d824b446ce33fbf120.zip
Address segfault in TCP, and fix wild card handling.
Diffstat (limited to 'tests')
-rw-r--r--tests/tcp.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/tcp.c b/tests/tcp.c
index 02b75795..ea97454e 100644
--- a/tests/tcp.c
+++ b/tests/tcp.c
@@ -16,5 +16,31 @@
TestMain("TCP Transport", {
nni_init();
trantest_test_all("tcp://127.0.0.1:4450");
+
+
+ Convey("We cannot connect to wild cards", {
+ nng_socket *s;
+
+ So(nng_open(&s, NNG_PROTO_PAIR) == 0);
+ Reset({
+ nng_close(s);
+ })
+ So(nng_dial(s, "tcp://*:5555", NULL, NNG_FLAG_SYNCH) == NNG_EADDRINVAL);
+ })
+
+ Convey("We can bind to wild card", {
+ nng_socket *s1;
+ nng_socket *s2;
+ So(nng_open(&s1, NNG_PROTO_PAIR) == 0);
+ So(nng_open(&s2, NNG_PROTO_PAIR) == 0);
+ Reset({
+ nng_close(s2);
+ nng_close(s1);
+ })
+ So(nng_listen(s1, "tcp://*:5599", NULL, NNG_FLAG_SYNCH) == 0);
+ So(nng_dial(s2, "tcp://127.0.0.1:5599", NULL, NNG_FLAG_SYNCH) == 0);
+ })
nni_fini();
+
+
})