using Sick.SafetyScanners.DataStructures;
using Sick.SafetyScanners.Types;
namespace Sick.SafetyScanners.Interfaces;
///
/// Interface for UDP receiver (not a connection - UDP is connectionless)
/// Used for receiving scan data packets from SICK Safety Scanner via UDP (push mode)
/// Note: This is NOT a "connection" - it's just a UDP socket receiver that binds to a local port
/// and waits for packets from the scanner
///
public interface IUdpClient : IDisposable
{
///
/// Indicates whether the UDP socket is open (ready to receive)
/// Note: UDP is connectionless, so this just checks if socket is bound/open
///
bool IsConnected { get; }
///
/// Gets the local port number assigned to this client
/// Returns null if socket is not bound yet
///
Port? LocalPort { get; }
///
/// Indicates whether data is available in the receiving buffer
///
bool IsDataAvailable { get; }
///
/// Starts receiving UDP packets on a dedicated high-priority thread
///
/// Callback function to handle received packets
void StartReceiving(Action packetHandler);
///
/// Stops the receiving thread
///
void Stop();
}