From 4e668fdd5b5da0d46f97d835249dbe5f0ea319a7 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 19 Oct 2017 15:16:25 -0700 Subject: fixes #84 Consider using msec for durations There is now a public nng_duration type. We have also updated the zerotier work to work with the signed int64_t's that the latst ZeroTier dev branch is using. --- tests/pubsub.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'tests/pubsub.c') diff --git a/tests/pubsub.c b/tests/pubsub.c index 0c59f10e..e79c3f1d 100644 --- a/tests/pubsub.c +++ b/tests/pubsub.c @@ -81,7 +81,7 @@ TestMain("PUB/SUB pattern", { So(nng_listen(sub, addr, NULL, 0) == 0); So(nng_dial(pub, addr, NULL, 0) == 0); - nng_usleep(20000); // give time for connecting threads + nng_msleep(20); // give time for connecting threads Convey("Sub can subscribe", { So(nng_setopt(sub, NNG_OPT_SUB_SUBSCRIBE, "ABC", 3) == @@ -110,8 +110,7 @@ TestMain("PUB/SUB pattern", { So(nng_setopt(sub, NNG_OPT_SUB_SUBSCRIBE, "/some/", strlen("/some/")) == 0); - So(nng_setopt_usec(sub, NNG_OPT_RECVTIMEO, 90000) == - 0); + So(nng_setopt_ms(sub, NNG_OPT_RECVTIMEO, 90) == 0); So(nng_msg_alloc(&msg, 0) == 0); APPENDSTR(msg, "/some/like/it/hot"); @@ -140,8 +139,7 @@ TestMain("PUB/SUB pattern", { Convey("Subs without subsciptions don't receive", { nng_msg *msg; - So(nng_setopt_usec(sub, NNG_OPT_RECVTIMEO, 90000) == - 0); + So(nng_setopt_ms(sub, NNG_OPT_RECVTIMEO, 90) == 0); So(nng_msg_alloc(&msg, 0) == 0); APPENDSTR(msg, "/some/don't/like/it"); @@ -153,8 +151,7 @@ TestMain("PUB/SUB pattern", { nng_msg *msg; - So(nng_setopt_usec(sub, NNG_OPT_RECVTIMEO, 90000) == - 0); + So(nng_setopt_ms(sub, NNG_OPT_RECVTIMEO, 90) == 0); So(nng_setopt_int(sub, NNG_OPT_RAW, 1) == 0); So(nng_msg_alloc(&msg, 0) == 0); -- cgit v1.2.3-70-g09d2