diff --git a/CHANGELOG.md b/CHANGELOG.md index be94f0bb..d7d19bc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * Add RTU support. See [#56](https://github.com/stepfunc/rodbus/pull/56). * Dynamic protocol decoding. See [#61](https://github.com/stepfunc/rodbus/pull/66). * Resolve host names on client. See [#68](https://github.com/stepfunc/rodbus/pull/68). +* Properly reset TCP connection retry timeout on success. See [#82](https://github.com/stepfunc/rodbus/issues/82). ### 0.9.1 ### * Client callbacks are now not blocking. diff --git a/rodbus/src/tcp/client.rs b/rodbus/src/tcp/client.rs index 1fa8f9a2..546bd8af 100644 --- a/rodbus/src/tcp/client.rs +++ b/rodbus/src/tcp/client.rs @@ -125,6 +125,10 @@ impl TcpChannelTask { } } Ok(mut phys) => { + // reset the retry strategy now that we have a successful connection + // we do this here so that the reset happens after a TLS handshake + self.connect_retry.reset(); + // run the physical layer independent processing loop match self.client_loop.run(&mut phys).await { // the mpsc was closed, end the task SessionError::Shutdown => return Shutdown,