Comments (8)
@DBTaylor Thanks for your feedback.
We'll try to reproduce this soon.
Probably this issue is related to the outdated tokio-proto
crate (see #18).
The next version of tokio-modbus will definitely get rid of it and will use the new async/await features of Rust. So if you're interested to help feel free to contact us :)
from tokio-modbus.
@uklotzde If you're bored: can you have a look at this?
from tokio-modbus.
@flosse Thanks for the quick response. Monday I'll put together a minimal program that reproduces this - I'll also check it on a Tier 1 target to make sure it's not a target specific issue. Glad to hear async/await support is coming - way easier to read than future combinators. I would totally help if I had any idea what I was doing.
from tokio-modbus.
@flosse here is a reproduction: https://github.com/DBTaylor/modbus-tcp-leak
It appears to be target agnostic. This issue sounds related, but it appears to have been fixed:
tokio-rs/tokio-proto#194
from tokio-modbus.
@DBTaylor Thanks for the example repo. I can reproduce the behavior on my machine.
I tried to build it with the current tokio-proto
master but unfortunately it's still the same :(
from tokio-modbus.
I've prepared a quick fix:
[patch.crates-io]
tokio-modbus = { git = "https://github.com/uklotzde/tokio-modbus.git", branch = "tcp_disconnect" }
After invoking disconnect() the connections will enter TIME_WAIT and should disappear after ~30 seconds (depending on your config). Does this solve your issues?
from tokio-modbus.
@uklotzde yep that works!
from tokio-modbus.
Great, I will prepare a release.
Your example with the testing instructions was a great help to quickly solve this bug!
from tokio-modbus.
Related Issues (20)
- "Device or resource busy" in RTU server example HOT 3
- Generalize impl around `Service` usage HOT 5
- Tokio module 'runtime' is private HOT 12
- Asyncronous responses / Multiplexing HOT 2
- How to convert tokio_modbus::Request to bytes? HOT 5
- TCP server example - shared data hashmap HOT 5
- TCP Sync Client HOT 6
- write_multiple_registers taking array as a param HOT 3
- Can not disconnect slave, need help HOT 3
- Although disconnect the context, the SerialStream reopen error HOT 1
- Patterns/best practice for reconnect-after-failure? HOT 1
- How to turn 'tokio_serial::SerialStream' into global static to save it for reuse
- is_connected()? HOT 1
- Modbus RTU - Serial Direction Pin HOT 6
- Dev Dependencies: Upgrade rustls-pemfile and tokio-rustls HOT 4
- Return Modbus exception codes for client and server.
- Use `async-trait` in `Service` trait ? HOT 10
- tokio-modbus 0.12 entering unreachable code in any response error HOT 7
- Dev Dependencies: Upgrade rustls
- How to get hexadecimal modbus rtu message data HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tokio-modbus.