ISocketFactory.cs 1.2 KB

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