Namespace WitShells.Broadcast
Classes
- BroadcastSender
Sends UDP broadcast packets with optional periodic modes. Modes:
- LoopSingle: repeat the same message at a fixed interval.
- UntilResponse: repeat until a response is observed (subscribe to a BroadcastService instance).
- RetryOnFailure: re-send only when local send throws; limited attempts.
- BroadcastService
Listens for UDP responses on a given port and raises events. Usage: var svc = new BroadcastService(); svc.OnResponseReceived += (msg, remote) => { ... }; svc.StartBroadcast("ip_request", port: 7777, repeatIntervalMs: 0, waitForResponses: true, singleResponse: false); svc.Stop(); svc.Dispose();