aboutsummaryrefslogtreecommitdiff
path: root/tests/compat_reqrep.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-10-19 15:16:25 -0700
committerGarrett D'Amore <garrett@damore.org>2017-10-19 17:56:49 -0700
commit4e668fdd5b5da0d46f97d835249dbe5f0ea319a7 (patch)
tree0aaad8a672024b3a510763150b167320be6f1f5b /tests/compat_reqrep.c
parentd7e39a2423212a31c5ef62dcb0b7a5b4bf9f34df (diff)
downloadnng-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/compat_reqrep.c')
-rw-r--r--tests/compat_reqrep.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/compat_reqrep.c b/tests/compat_reqrep.c
index 51ff4fb8..046955cf 100644
--- a/tests/compat_reqrep.c
+++ b/tests/compat_reqrep.c
@@ -1,5 +1,7 @@
/*
Copyright (c) 2012 Martin Sustrik All rights reserved.
+ Copyright 2017 Garrett D'Amore <garrett@damore.org>
+ Copyright 2017 Capitar IT Group BV <info@capitar.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),
@@ -26,8 +28,6 @@
#define SOCKET_ADDRESS "inproc://test"
-extern void nng_usleep(uint64_t);
-
int main ()
{
int rc;
@@ -75,7 +75,7 @@ int main ()
rep1 = test_socket (AF_SP, NN_REP);
test_connect (rep1, SOCKET_ADDRESS);
- nng_usleep(10000); // ensure rep1 binds before rep2
+ nn_sleep(10); // ensure rep1 binds before rep2
rep2 = test_socket (AF_SP, NN_REP);
test_connect (rep2, SOCKET_ADDRESS);
@@ -86,7 +86,7 @@ int main ()
test_setsockopt (rep2, NN_SOL_SOCKET, NN_RCVTIMEO, &timeo, sizeof (timeo));
// Give time for connections to settle -- required for LB stuff.
- nng_usleep(100000);
+ nn_sleep(100);
test_send (req1, "ABC");
test_recv (rep1, "ABC");
@@ -148,7 +148,7 @@ int main ()
rep1 = test_socket (AF_SP, NN_REP);
test_connect (rep1, SOCKET_ADDRESS);
rep2 = test_socket (AF_SP, NN_REP);
- nng_usleep(10000); // give time for rep1 to connect
+ nn_sleep (10); // give time for rep1 to connect
test_connect (rep2, SOCKET_ADDRESS);
timeo = 500; // Was 200, but Windows occasionally fails at that rate.