aboutsummaryrefslogtreecommitdiff
path: root/tests/pair1.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-08-11 16:14:08 -0700
committerGarrett D'Amore <garrett@damore.org>2017-08-11 16:14:08 -0700
commite2a5bbe4e59bba56cbe1138c9ae76c1e9af9ba66 (patch)
treebfc850d4282d0c8c356698aca74ed158db317e4f /tests/pair1.c
parent03f5d12c3b7f5b385d3dbe012b3465e54518b762 (diff)
downloadnng-e2a5bbe4e59bba56cbe1138c9ae76c1e9af9ba66.tar.gz
nng-e2a5bbe4e59bba56cbe1138c9ae76c1e9af9ba66.tar.bz2
nng-e2a5bbe4e59bba56cbe1138c9ae76c1e9af9ba66.zip
Fail to another stream on default (no pipe requested).
Diffstat (limited to 'tests/pair1.c')
-rw-r--r--tests/pair1.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/pair1.c b/tests/pair1.c
index d81309ef..62f7b1d6 100644
--- a/tests/pair1.c
+++ b/tests/pair1.c
@@ -357,14 +357,24 @@ TestMain("PAIRv1 protocol", {
So(nng_listen(s1, addr, NULL, NNG_FLAG_SYNCH) == 0);
So(nng_dial(c1, addr, NULL, NNG_FLAG_SYNCH) == 0);
+ nng_usleep(100000);
+ So(nng_dial(c2, addr, NULL, NNG_FLAG_SYNCH) == 0);
So(nng_msg_alloc(&msg, 0) == 0);
APPENDSTR(msg, "YES");
So(nng_sendmsg(s1, msg, 0) == 0);
So(nng_recvmsg(c1, &msg, 0) == 0);
CHECKSTR(msg, "YES");
- p1 = nng_msg_get_pipe(msg);
- So(p1 != 0);
+ nng_msg_free(msg);
+
+ nng_close(c1);
+ nng_usleep(10000);
+
+ So(nng_msg_alloc(&msg, 0) == 0);
+ APPENDSTR(msg, "AGAIN");
+ So(nng_sendmsg(s1, msg, 0) == 0);
+ So(nng_recvmsg(c2, &msg, 0) == 0);
+ CHECKSTR(msg, "AGAIN");
nng_msg_free(msg);
});