ISocketFactory.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. #pragma warning disable CS1591
  2. using System.Collections.Generic;
  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. /// <param name="localIp">The local IP address to bind to.</param>
  16. /// <param name="localPort">The local port to bind to.</param>
  17. /// <returns>A new unicast socket using the specified local port number.</returns>
  18. ISocket CreateSsdpUdpSocket(IPAddress localIp, int localPort);
  19. /// <summary>
  20. /// Creates a new multicast socket using the specified multicast IP address, multicast time to live and local port.
  21. /// </summary>
  22. /// <param name="ipAddress">The multicast IP address to bind to.</param>
  23. /// <param name="bindIpAddress">The bind IP address.</param>
  24. /// <param name="multicastTimeToLive">The multicast time to live value. Actually a maximum number of network hops for UDP packets.</param>
  25. /// <param name="localPort">The local port to bind to.</param>
  26. /// <returns>A <see cref="ISocket"/> implementation.</returns>
  27. ISocket CreateUdpMulticastSocket(IPAddress ipAddress, IPAddress bindIpAddress, int multicastTimeToLive, int localPort);
  28. }
  29. }