示例#1
0
        public SsdpHandler()
        {
            notificationTimer.Elapsed += Tick;
            notificationTimer.Enabled  = true;

            queueTimer.Elapsed += ProcessQueue;

            client.Client.UseOnlyOverlappedIO = true;
            client.Client.SetSocketOption(
                SocketOptionLevel.Socket,
                SocketOptionName.ReuseAddress,
                true
                );
            client.ExclusiveAddressUse = false;
            client.Client.Bind(new IPEndPoint(IPAddress.Any, SSDP_PORT));
            client.JoinMulticastGroup(SSDP_IP, 10);
            _logger.Notice("SSDP service started");
            Receive();
        }