aboutsummaryrefslogtreecommitdiff
path: root/tests/compat_reqrep.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-24 08:45:53 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-24 08:45:53 -0800
commit4c496d8182b5f3a5db6ca8fd763bab444e39f48a (patch)
tree1ec220c70d08951ce0f37d58255bd49d485c7701 /tests/compat_reqrep.c
parent7df0822d3ed58ee73918cac576c0b07363e84425 (diff)
downloadnng-4c496d8182b5f3a5db6ca8fd763bab444e39f48a.tar.gz
nng-4c496d8182b5f3a5db6ca8fd763bab444e39f48a.tar.bz2
nng-4c496d8182b5f3a5db6ca8fd763bab444e39f48a.zip
Implement reconnect timer including backoff.
This allows us to enable the last test case for compat_reqrep.
Diffstat (limited to 'tests/compat_reqrep.c')
-rw-r--r--tests/compat_reqrep.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/compat_reqrep.c b/tests/compat_reqrep.c
index a418b8d9..51ff4fb8 100644
--- a/tests/compat_reqrep.c
+++ b/tests/compat_reqrep.c
@@ -121,29 +121,24 @@ int main ()
test_close (rep1);
-#if 0 // The default reconnect interval is waaay to large for this to pass.
/* Check sending a request when the peer is not available. (It should
be sent immediatelly when the peer comes online rather than relying
on the resend algorithm. */
req1 = test_socket (AF_SP, NN_REQ);
timeo = 10;
- rc = nn_setsockopt (req1, NN_SOL_SOCKET, NN_RECONNECT_IVL,
- &timeo, sizeof (timeo));
+ test_setsockopt (req1, NN_SOL_SOCKET, NN_RECONNECT_IVL, &timeo, sizeof (timeo));
test_send (req1, "ABC");
test_connect (req1, SOCKET_ADDRESS);
rep1 = test_socket (AF_SP, NN_REP);
test_bind (rep1, SOCKET_ADDRESS);
timeo = 500;
- rc = nn_setsockopt (rep1, NN_SOL_SOCKET, NN_RCVTIMEO,
- &timeo, sizeof (timeo));
- printf("RC = %d errno %d (%s)\n", rc, errno, strerror(errno));
+ test_setsockopt (rep1, NN_SOL_SOCKET, NN_RCVTIMEO, &timeo, sizeof (timeo));
errno_assert (rc == 0);
test_recv (rep1, "ABC");
test_close (req1);
test_close (rep1);
-#endif
/* Check removing socket request sent to (It should
be sent immediatelly to other peer rather than relying