private void HandleDeviceCreation(UPnPDeviceFactory Factory, UPnPDevice device, Uri URL)
 {
     Factory.Shutdown();
     if (OnCreateDevice != null)
     {
         OnCreateDevice(device, URL);
     }
 }
 private void HandleFactory(UPnPDeviceFactory Factory, UPnPDevice device, Uri URL)
 {
     lock (CreateTable) { CreateTable.Remove(Factory); }
     Factory.Shutdown();
     if (OnDevice != null)
     {
         OnDevice(this, device, URL);
     }
 }
 private void FactoryFailedSink(UPnPDeviceFactory sender, Uri URL, Exception e, string urn)
 {
     lock (CreateTable)
     {
         CreateTable.Remove(sender);
         sender.Shutdown();
     }
     if (OnFailed != null)
     {
         OnFailed(this, URL, e, urn);
     }
 }
 private void HandleFactory(UPnPDeviceFactory Factory, UPnPDevice device, Uri URL)
 {
     lock (CreateTable) { CreateTable.Remove(Factory); }
     Factory.Shutdown();
     if (OnDevice != null) OnDevice(this, device, URL);
 }
 private void FactoryFailedSink(UPnPDeviceFactory sender, Uri URL, Exception e, string urn)
 {
     lock (CreateTable)
     {
         CreateTable.Remove(sender);
         sender.Shutdown();
     }
     if (OnFailed != null) OnFailed(this, URL, e, urn);
 }
Esempio n. 6
0
 private void HandleDeviceCreation(UPnPDeviceFactory Factory, UPnPDevice device, Uri URL)
 {
     Factory.Shutdown();
     if (OnCreateDevice != null)
     {
         OnCreateDevice(device, URL);
     }
 }
        private void ProxySink_NoReverse(UPnPDeviceFactory sender, UPnPDevice d, Uri LocationUri)
        {
            FactoryTable.Remove(sender);
            sender.Shutdown();
            CpGateKeeper CP = new CpGateKeeper(d.GetServices(CpGateKeeper.SERVICE_NAME)[0]);
            lock(RegisteredTable)
            {
                RegisteredTable[CP.GetUPnPService().ParentDevice.UniqueDeviceName] = CP;
                object[] PL = (object[])ProcessLaterList.ToArray(typeof(object));
                foreach(object PL2 in PL)
                {
                    object[] PL3 = (object[])PL2;
                    string SenderUDN = (string)PL3[0];
                    string DeviceUDN = (string)PL3[1];

                    if(RegisteredTable.ContainsKey(SenderUDN))
                    {
                        CpGateKeeper HOME = (CpGateKeeper)RegisteredTable[SenderUDN];
                        HOME.GetDocument(DeviceUDN,"",null,new CpGateKeeper.Delegate_OnResult_GetDocument(CPGetDocumentSink));
                        ProcessLaterList.Remove(PL2);
                    }
                }
            }
            foreach(UPnPDevice t in ShareList)
            {
                CP.AddDevice(Root.UniqueDeviceName,t.UniqueDeviceName);
            }
        }
        private void ProxySink(UPnPDeviceFactory sender, UPnPDevice d, Uri LocationUri)
        {
            FactoryTable.Remove(sender);
            sender.Shutdown();
            CpGateKeeper CP = new CpGateKeeper(d.GetServices(CpGateKeeper.SERVICE_NAME)[0]);
            string useThisIP = d.InterfaceToHost.ToString();

            if(this.PublicIP!="") {useThisIP = PublicIP;}

            lock(RegisteredTable)
            {
                RegisteredTable[CP.GetUPnPService().ParentDevice.UniqueDeviceName] = CP;
                object[] PL = (object[])ProcessLaterList.ToArray(typeof(object));
                foreach(object PL2 in PL)
                {
                    object[] PL3 = (object[])PL2;
                    string SenderUDN = (string)PL3[0];
                    string DeviceUDN = (string)PL3[1];

                    if(RegisteredTable.ContainsKey(SenderUDN))
                    {
                        CpGateKeeper HOME = (CpGateKeeper)RegisteredTable[SenderUDN];
                        HOME.GetDocument(DeviceUDN,"",null,new CpGateKeeper.Delegate_OnResult_GetDocument(CPGetDocumentSink));
                        ProcessLaterList.Remove(PL2);
                    }
                }
            }
            foreach(UPnPDevice t in ShareList)
            {
                CP.AddDevice(Root.UniqueDeviceName,t.UniqueDeviceName);
            }

            CP.Register(new Uri("http://" + useThisIP + ":" + Port.ToString()),false);
        }
 private void FactoryFailedSink(UPnPDeviceFactory sender, Uri URL, Exception e, string urn)
 {
     OpenSource.Utilities.EventLogger.Log(this, System.Diagnostics.EventLogEntryType.Warning, "Factory Failed Sync!!");
     lock (CreateTable)
     {
         CreateTable.Remove(sender);
         sender.Shutdown();
     }
     if (OnFailed != null) OnFailed (this, URL, e, urn);
 }