S7NetPlus / s7netplus

S7.NET+ -- A .NET library to connect to Siemens Step7 devices
MIT License
1.33k stars 588 forks source link

Open() not controlled by ReadTimeout and/or WriteTimeout #409

Open HLFCode opened 3 years ago

HLFCode commented 3 years ago

There should be a way to control the wait time when opening a connection. It seems that ReadTimeout and WriteTimeout only work used after a successful Open().

Thanks for an excellent project Mike

scamille commented 3 years ago

Unfortunately .NET (with the targeted versions) does not really support this easily.

There seem to be new overloads with NET5.0+ accepting CancellationTokens, which would also make it easy to add a timeout. Not sure how reliable this would be in practice though.