Close channel after all nodes dissappear
Kester-Broatch opened this issue · 2 comments
Hi there,
I noticed when you disconnect a UDP server (ip = 0.0.0.0) endpoint and we get a node disappeared
message for the device(s) at that endpoint the channel never closes.
This has the effect that mavp2p will continue sending messages to that channel indefinitely, i confirmed this with wireshark. In our case it keeps sending UDP messages out into the void over cellular, so its a quite expensive issue! 😅
So it would be good to close a UDP server channel when all known nodes on it disappear.
What are your thoughts?
Thanks, Kester
Hello, thanks for reporting the issue. I checked and the library didn't provide any mechanism to close idle channels, so i did the following:
- i implemented a mechanism to close idle channels after i timeout in bluenviron/gomavlib#61
- i added flag
--idle-timeout
to set the idle timeout (that by default is 60secs) - i released a new version (v1.1.0).
Hi, thanks for implementing this fix! I will implement and test this fix in the next few weeks and get back to you :)