Skip to content

Commit

Permalink
reset TCP connection logic when a successful connection happens (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
jadamcrain authored Aug 3, 2022
1 parent 032bee2 commit 687608a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions rodbus/src/tcp/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 687608a

Please sign in to comment.