lifeemotions / knx.net

KNX.net provides a KNX API for .NET
MIT License
101 stars 47 forks source link

Do I have to keep alive a long knx tunneling connection? #30

Closed mronnlun closed 7 years ago

mronnlun commented 7 years ago

I'm creating a window service that will monitor knx events.

Should I do something manually to keep alive the connection, like requesting a status every minute, or isn't it needed?

abelsilva commented 7 years ago

For any type of connection you don't need to do anything

KNX Routing doesn't have state KNX Tunneling (the one you're using) already has it's own keep alive (implemented in knx.net)

If you still want to be sure you can always request the state of the devices you want to monitor each X secs/mins

abelsilva commented 7 years ago

https://github.com/lifeemotions/knx.net/blob/master/src/KNXLib/KnxConnectionTunneling.cs#L203

Method StateRequest is called every 60s to send the 'keep alive'

mronnlun commented 7 years ago

Thanks for the info. I have now had a connection up for a week without problems.

When I look at my own logs, the keep alive polling address seems to be 1/1/1 because that is regularly shown in my logs. Maybe that address could be specified in the constructor to some defined value that I could then filter out.