slowtec / tokio-modbus

A tokio-based modbus library
Apache License 2.0
379 stars 117 forks source link

Allow for injection of TcpStream #216

Closed fauve-edf closed 5 months ago

fauve-edf commented 10 months ago

What

Allows for creating a Context with a custom tokio TcpStream.

Why

I want to be able to configure the socket. For example, you could set connect, read, and write timeouts. Really you could go hog wild and do whatever you want.

uklotzde commented 10 months ago

The last pre-commit failures are unrelated. Please rebase on #217 or wait until this PR has been merged.

dr-kernel commented 7 months ago

I would like to see this as well, I'm having issues where a write doesn't timeout forever.

uklotzde commented 5 months ago

Ping.

fauve-edf commented 5 months ago

Just to make sure, this functionality isn't just replicating https://docs.rs/tokio-modbus/latest/tokio_modbus/client/tcp/fn.attach.html ?

uklotzde commented 5 months ago

Just to make sure, this functionality isn't just replicating https://docs.rs/tokio-modbus/latest/tokio_modbus/client/tcp/fn.attach.html ?

Indeed. Looks like this PR is obsolete.