Beispiel #1
0
        /// <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);
        }
Beispiel #2
0
        /// <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;
        }
Beispiel #3
0
        /// <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;
        }
Beispiel #4
0
        /// <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,
                };
        }
Beispiel #5
0
        /// <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,
            };
        }
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SsdpClient"/> class.
 /// </summary>
 public SsdpClient(ISsdpSocket socket = null)
     : base(socket)
 {
 }
Beispiel #7
0
 /// <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>();
 }
Beispiel #8
0
 /// <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;
 }
Beispiel #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SsdpClient"/> class.
 /// </summary>
 public SsdpClient(ISsdpSocket socket = null)
     : base(socket)
 {
 }
Beispiel #10
0
 /// <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;
 }