IUdpSocket.cs 739 B

12345678910111213141516171819202122232425
  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<SocketReceiveResult> ReceiveAsync();
  18. /// <summary>
  19. /// Sends a UDP message to a particular end point (uni or multicast).
  20. /// </summary>
  21. Task SendAsync(byte[] buffer, int bytes, IpEndPointInfo endPoint);
  22. }
  23. }