Пример #1
0
        public UPnPControlPoint(NetworkInfo ni)
        {
            CreateTable         = Hashtable.Synchronized(new Hashtable());
            NetInfo             = ni;
            SyncData            = ArrayList.Synchronized(new ArrayList());
            SSDPSessions        = Hashtable.Synchronized(new Hashtable());
            Lifetime            = new LifeTimeMonitor();
            Lifetime.OnExpired += HandleExpired;

            SSDPServer           = new SSDP(65535);
            SSDPServer.OnNotify += HandleNotify;
        }
        public UPnPInternalSmartControlPoint()
        {
            deviceFactory.OnDevice        += DeviceFactoryCreationSink;
            deviceFactory.OnFailed        += DeviceFactoryFailedSink;
            deviceLifeTimeClock.OnExpired += DeviceLifeTimeClockSink;
            deviceUpdateClock.OnExpired   += DeviceUpdateClockSink;

            hostNetworkInfo = new NetworkInfo(NetworkInfoNewInterfaceSink);
            hostNetworkInfo.OnInterfaceDisabled += NetworkInfoOldInterfaceSink;

            // Launch a search for all devices and start populating the
            // internal smart control point device list.
            genericControlPoint           = new UPnPControlPoint();
            genericControlPoint.OnSearch += UPnPControlPointSearchSink;
            genericControlPoint.OnNotify += SSDPNotifySink;

            genericControlPoint.FindDeviceAsync("upnp:rootdevice");
        }
Пример #3
0
        /// <summary>
        /// Constructs a new SSDP Server
        /// </summary>
        /// <param name="Expiration">The number of seconds before a Refresh will be triggered</param>
        public SSDP(int Expiration)
        {
            InstanceTracker.Add(this);
            LifeTimeHandler        = SearchTimerSink;
            SearchTimer.OnExpired += LifeTimeHandler;

            SSDP_EXPIRATION = Expiration;
            if (SSDP_EXPIRATION < 5)
            {
                SSDP_EXPIRATION = 5;
            }
            int MinVal = (int)(SSDP_EXPIRATION * 0.25 * 1000);
            int MaxVal = (int)(SSDP_EXPIRATION * 0.45 * 1000);

            NotifyTimer.OnElapsed += __NotifyCheck;
            NotifyTimer.Interval   = RND.Next(MinVal, MaxVal);
            NotifyTimer.AutoReset  = true;
            NotifyTimer.Start();

            NetInfo = new NetworkInfo();
            SetupSessions();
        }
Пример #4
0
 private void NewInterface(NetworkInfo sender, IPAddress Intfce)
 {
 }