From a86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Thu, 27 Dec 2018 18:27:57 -0500 Subject: Add GPL modules --- MediaBrowser.Model/Net/ISocketFactory.cs | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 MediaBrowser.Model/Net/ISocketFactory.cs (limited to 'MediaBrowser.Model/Net/ISocketFactory.cs') diff --git a/MediaBrowser.Model/Net/ISocketFactory.cs b/MediaBrowser.Model/Net/ISocketFactory.cs new file mode 100644 index 000000000..6a4b99600 --- /dev/null +++ b/MediaBrowser.Model/Net/ISocketFactory.cs @@ -0,0 +1,49 @@ + +using System.IO; + +namespace MediaBrowser.Model.Net +{ + /// + /// Implemented by components that can create a platform specific UDP socket implementation, and wrap it in the cross platform interface. + /// + public interface ISocketFactory + { + + /// + /// Createa a new unicast socket using the specified local port number. + /// + /// The local port to bind to. + /// A implementation. + ISocket CreateUdpSocket(int localPort); + + ISocket CreateUdpBroadcastSocket(int localPort); + + ISocket CreateTcpSocket(IpAddressInfo remoteAddress, int remotePort); + + /// + /// Createa a new unicast socket using the specified local port number. + /// + ISocket CreateSsdpUdpSocket(IpAddressInfo localIp, int localPort); + + /// + /// Createa a new multicast socket using the specified multicast IP address, multicast time to live and local port. + /// + /// The multicast IP address to bind to. + /// The multicast time to live value. Actually a maximum number of network hops for UDP packets. + /// The local port to bind to. + /// A implementation. + ISocket CreateUdpMulticastSocket(string ipAddress, int multicastTimeToLive, int localPort); + + Stream CreateNetworkStream(ISocket socket, bool ownsSocket); + } + + public enum SocketType + { + Stream + } + + public enum ProtocolType + { + Tcp + } +} -- cgit v1.2.3