/// <summary> /// Initializes a new instance of the <see cref="SsdpListener" /> class. /// </summary> /// <param name="sockets">The ssdp sockets.</param> public SsdpListener(ISsdpSocket[] sockets) { if (sockets.Length == 0) sockets = SsdpSocketFactory.BuildSockets().ToArray(); this.Sockets = new SsdpSocketCollection(sockets); this.Sockets.ForEachSocket(socket => socket.SsdpMessageReceived += this.OnSsdpMessageReceived); }
/// <summary> /// Initializes a new instance of the <see cref="SsdpSearch"/> class. /// </summary> public SsdpSearch(ISsdpSocket socket = null) { if (socket == null) { socket = new SsdpSocket(); this.OwnsServer = true; } this.Server = socket; this.HostEndpoint = Protocol.DiscoveryEndpoints.IPv4; this.SearchType = Protocol.SsdpAll; this.Mx = Protocol.DefaultMx; }
/// <summary> /// Initializes a new instance of the <see cref="SsdpSearch"/> class. /// </summary> public SsdpSearch(ISsdpSocket socket = null) { if (socket == null) { socket = new SsdpSocket(); this.OwnsServer = true; } this.Server = socket; this.HostEndpoint = Protocol.DiscoveryEndpoints.IPv4; this.SearchType = Protocol.SsdpAll; this.Mx = Protocol.DefaultMx; }
/// <summary> /// Initializes a new instance of the <see cref="SsdpAnnouncer" /> class. /// </summary> /// <param name="server">The server.</param> public SsdpAnnouncer(ISsdpSocket server = null) { if (server == null) { server = new SsdpSocket(); this.OwnsServer = true; } this.Server = server; this.UserAgent = Protocol.DefaultUserAgent; this.MaxAge = Protocol.DefaultMaxAge; this.NotificationType = string.Empty; this.USN = string.Empty; this.Location = string.Empty; this.RemoteEndPoints = new BlockingCollection<IPEndPoint> { Protocol.DiscoveryEndpoints.IPv4, Protocol.DiscoveryEndpoints.Broadcast, }; }
/// <summary> /// Initializes a new instance of the <see cref="SsdpAnnouncer" /> class. /// </summary> /// <param name="server">The server.</param> public SsdpAnnouncer(ISsdpSocket server = null) { if (server == null) { server = new SsdpSocket(); this.OwnsServer = true; } this.Server = server; this.UserAgent = Protocol.DefaultUserAgent; this.MaxAge = Protocol.DefaultMaxAge; this.NotificationType = string.Empty; this.USN = string.Empty; this.Location = string.Empty; this.RemoteEndPoints = new BlockingCollection <IPEndPoint> { Protocol.DiscoveryEndpoints.IPv4, Protocol.DiscoveryEndpoints.Broadcast, }; }
/// <summary> /// Initializes a new instance of the <see cref="SsdpClient"/> class. /// </summary> public SsdpClient(ISsdpSocket socket = null) : base(socket) { }
/// <summary> /// Initializes a new instance of the <see cref="SsdpServer"/> class. /// </summary> public SsdpServer(ISsdpSocket socket = null) : base(socket) { this.Announcers = new Dictionary <ISsdpAnnouncer, bool>(); }
/// <summary> /// Initializes a new instance of the <see cref="SsdpListener" /> class. /// </summary> public SsdpListener(ISsdpSocket socket = null) { this.Server = socket ?? new SsdpSocket(new IPEndPoint(IPAddress.Any, 1900)); this.Server.SsdpMessageReceived += this.OnSsdpMessageReceived; }
/// <summary> /// Initializes a new instance of the <see cref="SsdpClient"/> class. /// </summary> public SsdpClient(ISsdpSocket socket = null) : base(socket) { }
/// <summary> /// Initializes a new instance of the <see cref="SsdpListener" /> class. /// </summary> public SsdpListener(ISsdpSocket socket = null) { this.Server = socket ?? new SsdpSocket(new IPEndPoint(IPAddress.Any, 1900)); this.Server.SsdpMessageReceived += this.OnSsdpMessageReceived; }