IUdpSocket.cs 909 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace MediaBrowser.Model.Net
  7. {
  8. /// <summary>
  9. /// Provides a common interface across platforms for UDP sockets used by this SSDP implementation.
  10. /// </summary>
  11. public interface IUdpSocket : IDisposable
  12. {
  13. /// <summary>
  14. /// Waits for and returns the next UDP message sent to this socket (uni or multicast).
  15. /// </summary>
  16. /// <returns></returns>
  17. Task<ReceivedUdpData> ReceiveAsync();
  18. /// <summary>
  19. /// Sends a UDP message to a particular end point (uni or multicast).
  20. /// </summary>
  21. /// <param name="messageData">The data to send.</param>
  22. /// <param name="endPoint">The <see cref="IpEndPointInfo"/> providing the address and port to send to.</param>
  23. Task SendTo(byte[] messageData, IpEndPointInfo endPoint);
  24. }
  25. }