diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-10-19 15:16:25 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-10-19 17:56:49 -0700 |
| commit | 4e668fdd5b5da0d46f97d835249dbe5f0ea319a7 (patch) | |
| tree | 0aaad8a672024b3a510763150b167320be6f1f5b /tests/reconnect.c | |
| parent | d7e39a2423212a31c5ef62dcb0b7a5b4bf9f34df (diff) | |
| download | nng-4e668fdd5b5da0d46f97d835249dbe5f0ea319a7.tar.gz nng-4e668fdd5b5da0d46f97d835249dbe5f0ea319a7.tar.bz2 nng-4e668fdd5b5da0d46f97d835249dbe5f0ea319a7.zip | |
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.
Diffstat (limited to 'tests/reconnect.c')
| -rw-r--r-- | tests/reconnect.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/reconnect.c b/tests/reconnect.c index 4324a84b..8179055d 100644 --- a/tests/reconnect.c +++ b/tests/reconnect.c @@ -32,18 +32,18 @@ TestMain("Reconnect works", { nng_close(pull); }); - So(nng_setopt_usec(pull, NNG_OPT_RECONNMINT, 10000) == 0); - So(nng_setopt_usec(pull, NNG_OPT_RECONNMAXT, 10000) == 0); + So(nng_setopt_ms(pull, NNG_OPT_RECONNMINT, 10) == 0); + So(nng_setopt_ms(pull, NNG_OPT_RECONNMAXT, 10) == 0); Convey("Dialing before listening works", { So(nng_dial(push, addr, NULL, NNG_FLAG_NONBLOCK) == 0); - nng_usleep(100000); + nng_msleep(100); So(nng_listen(pull, addr, NULL, 0) == 0); Convey("We can send a frame", { nng_msg *msg; - nng_usleep(100000); + nng_msleep(100); So(nng_msg_alloc(&msg, 0) == 0); APPENDSTR(msg, "hello"); So(nng_sendmsg(push, msg, 0) == 0); @@ -58,7 +58,7 @@ TestMain("Reconnect works", { nng_listener l; So(nng_dial(push, addr, NULL, NNG_FLAG_NONBLOCK) == 0); So(nng_listen(pull, addr, &l, 0) == 0); - nng_usleep(100000); + nng_msleep(100); nng_listener_close(l); So(nng_listen(pull, addr, NULL, 0) == 0); @@ -66,7 +66,7 @@ TestMain("Reconnect works", { nng_msg *msg; nng_pipe p1; - nng_usleep(100000); + nng_msleep(100); So(nng_msg_alloc(&msg, 0) == 0); APPENDSTR(msg, "hello"); So(nng_sendmsg(push, msg, 0) == 0); @@ -81,7 +81,7 @@ TestMain("Reconnect works", { nng_pipe p2; nng_pipe_close(p1); - nng_usleep(100000); + nng_msleep(100); So(nng_msg_alloc(&msg, 0) == 0); APPENDSTR(msg, "again"); So(nng_sendmsg(push, msg, 0) == 0); |
