ISocketFactory.cs 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. #pragma warning disable CS1591
  2. using System.Net;
  3. namespace MediaBrowser.Model.Net
  4. {
  5. /// <summary>
  6. /// Implemented by components that can create a platform specific UDP socket implementation, and wrap it in the cross platform <see cref="ISocket"/> interface.
  7. /// </summary>
  8. public interface ISocketFactory
  9. {
  10. ISocket CreateUdpBroadcastSocket(int localPort);
  11. /// <summary>
  12. /// Creates a new unicast socket using the specified local port number.
  13. /// </summary>
  14. /// <param name="localIp">The local IP address to bind to.</param>
  15. /// <param name="localPort">The local port to bind to.</param>
  16. /// <returns>A new unicast socket using the specified local port number.</returns>
  17. ISocket CreateSsdpUdpSocket(IPAddress localIp, int localPort);
  18. /// <summary>
  19. /// Creates a new multicast socket using the specified multicast IP address, multicast time to live and local port.
  20. /// </summary>
  21. /// <param name="ipAddress">The multicast IP address to bind to.</param>
  22. /// <param name="multicastTimeToLive">The multicast time to live value. Actually a maximum number of network hops for UDP packets.</param>
  23. /// <param name="localPort">The local port to bind to.</param>
  24. /// <returns>A <see cref="ISocket"/> implementation.</returns>
  25. ISocket CreateUdpMulticastSocket(string ipAddress, int multicastTimeToLive, int localPort);
  26. }
  27. }