Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding CancellationToken to infinite loop, or return after disconnect #3

Open
brianmathews opened this issue Oct 6, 2024 · 0 comments

Comments

@brianmathews
Copy link

The current UdpLoop() method is an infinite loop and there does not appear to be a way to end this loop.
I find that if the WSJT-X application exits, crashes, or fails the UdpLoop will happily run forever and the parent caller doesn't get the opportunity to automatically re-connect.

I would two things:

  1. A way for the caller to pass in a CancellationToken to end the endless loop on demand
  2. Modify the UdpLoop with a watchdog timer such that the loop exits with an error if no heartbeat message is received in a certain time period.

For example, I would like the constructor to have this signature (or similar):

public WsjtxClient(Action<WsjtxMessage, IPEndPoint> callback, IPAddress ipAddress, int port = 2237, bool multicast = false, bool debug = false, int heartbeatWatchdogSeconds = 60, CancellationToken cancellationToken = default)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant