IUdpSocket.cs 822 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. IpAddressInfo LocalIPAddress { get; }
  14. /// <summary>
  15. /// Waits for and returns the next UDP message sent to this socket (uni or multicast).
  16. /// </summary>
  17. /// <returns></returns>
  18. Task<SocketReceiveResult> ReceiveAsync();
  19. /// <summary>
  20. /// Sends a UDP message to a particular end point (uni or multicast).
  21. /// </summary>
  22. Task SendAsync(byte[] buffer, int bytes, IpEndPointInfo endPoint);
  23. }
  24. }