ISocketFactory.cs 1.1 KB

1234567891011121314151617181920212223242526
  1. 
  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="IUdpSocket"/> interface.
  6. /// </summary>
  7. public interface ISocketFactory
  8. {
  9. /// <summary>
  10. /// Createa a new unicast socket using the specified local port number.
  11. /// </summary>
  12. /// <param name="localPort">The local port to bind to.</param>
  13. /// <returns>A <see cref="IUdpSocket"/> implementation.</returns>
  14. IUdpSocket CreateUdpSocket(int localPort);
  15. /// <summary>
  16. /// Createa a new multicast socket using the specified multicast IP address, multicast time to live and local port.
  17. /// </summary>
  18. /// <param name="ipAddress">The multicast IP address to bind to.</param>
  19. /// <param name="multicastTimeToLive">The multicast time to live value. Actually a maximum number of network hops for UDP packets.</param>
  20. /// <param name="localPort">The local port to bind to.</param>
  21. /// <returns>A <see cref="IUdpSocket"/> implementation.</returns>
  22. IUdpSocket CreateUdpMulticastSocket(string ipAddress, int multicastTimeToLive, int localPort);
  23. }
  24. }