ISocketFactory.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132
  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="bindIpAddress">The bind IP address.</param>
  23. /// <param name="multicastTimeToLive">The multicast time to live value. Actually a maximum number of network hops for UDP packets.</param>
  24. /// <param name="localPort">The local port to bind to.</param>
  25. /// <returns>A <see cref="ISocket"/> implementation.</returns>
  26. ISocket CreateUdpMulticastSocket(IPAddress ipAddress, IPAddress bindIpAddress, int multicastTimeToLive, int localPort);
  27. }
  28. }