From dc7241fa789b3509f63c67f9407e07e04882e973 Mon Sep 17 00:00:00 2001 From: amigin Date: Wed, 31 Jul 2024 23:08:45 +0300 Subject: [PATCH] Fixes --- src/tcp_client/tcp_client.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tcp_client/tcp_client.rs b/src/tcp_client/tcp_client.rs index 8166336..df4643b 100644 --- a/src/tcp_client/tcp_client.rs +++ b/src/tcp_client/tcp_client.rs @@ -23,7 +23,7 @@ const DEFAULT_SEND_TIMEOUT: Duration = Duration::from_secs(30); pub struct TcpClient { settings: Arc, re_connect_timeout: Duration, - seconds_to_ping: Duration, + seconds_to_ping: usize, disconnect_timeout: Duration, name: Arc, max_send_payload_size: usize, @@ -41,7 +41,7 @@ impl TcpClient { Self { settings, re_connect_timeout: Duration::from_secs(3), - seconds_to_ping: Duration::from_secs(3), + seconds_to_ping: 3, disconnect_timeout: Duration::from_secs(9), name: Arc::new(name), max_send_payload_size: DEFAULT_MAX_SEND_PAYLOAD_SIZE, @@ -52,8 +52,8 @@ impl TcpClient { } } - pub fn set_ping_interval(mut self, duration: Duration) -> Self { - self.seconds_to_ping = duration; + pub fn set_seconds_to_ping(mut self, seconds: usize) -> Self { + self.seconds_to_ping = seconds; self }