Open christianhubmann opened 6 years ago
That Thread.Sleep(200)
happens after you send the action
Now, if you send multiple actions that Sleep
will have an impact
The reason it exists is because while working with multiple KNX IP Interfaces and Routers we noticed a lot of actions were being discarded when we ran scenarios with multiple actions at the same time (e.g.: turning off all lights)
With the Sleep
, the actions would take more time but would work
I'll add a parameter in the library to adjust (or disable) this behaviour so it can be possible to test without the delay
can you try version 1.1.10
?
You will be able to do this:
var connection = new KnxConnectionTunneling("10.0.250.20", 3671, "10.0.253.5", 3671) { Debug = false };
connection.SetLockIntervalMs(0);
I didn't know it would sleep. I implemented my own sleep between actions. Maybe this should be documented somewhere.
I really like this library and it seems to be very well written. But I noticed that sending actions is kind of slow. Digging around the code in KnxLockManager.cs I found that PerformLockedOperation does a Thread.Sleep(200).
How did you come up with this value? I tried 50 and even 20 and it still works on my installation. Is this required by the KNX spec?