Skip to content

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

@brianmathews

Description

@brianmathews

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions