From 989c5e90d48066b12ad44ed903cfc163d8e89b29 Mon Sep 17 00:00:00 2001 From: Janjaap Bos Date: Wed, 3 Apr 2019 16:52:40 +0200 Subject: Tuning zt transport ping There is quite some package loss, which I will pursue later (in nng / zerotier). For now it helps to tune these settings to keep the peer relations. --- src/transport/zerotier/zerotier.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/transport/zerotier/zerotier.c b/src/transport/zerotier/zerotier.c index 2c94f0fb..bd8e5d56 100644 --- a/src/transport/zerotier/zerotier.c +++ b/src/transport/zerotier/zerotier.c @@ -78,7 +78,7 @@ static const uint32_t zt_port_mask = 0xffffffu; // mask of valid ports static const uint32_t zt_port_shift = 24; static const int zt_conn_tries = 240; // max connect attempts static const nng_duration zt_conn_time = 500; // between attempts (msec) -static const int zt_ping_tries = 5; // max keepalive attempts +static const int zt_ping_tries = 10; // max keepalive attempts static const nng_duration zt_ping_time = 60000; // keepalive time (msec) // These are compile time tunables for now. @@ -2037,7 +2037,7 @@ zt_pipe_ping_cb(void *arg) nni_mtx_unlock(&zt_lk); return; } - if (p->zp_ping_try >= p->zp_ping_tries) { + if (p->zp_ping_try > p->zp_ping_tries) { // Ping count exceeded; the other side is AFK. // Close the pipe, but no need to send a reason to the peer. zt_pipe_close_err(p, NNG_ECLOSED, 0, NULL); -- cgit v1.2.3-70-g09d2