ISocketFactory.cs 1.2 KB

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