Esempio n. 1
0
        void RegisterInternal(ControlRegistrationData data, UdpControlService serviceInstance)
        {
            if (this.State != CommunicationState.Opened)
            {
                return;
            }

            App app = appQueue.Lookup(data.Uri);

            if (app == null)
            {
                throw new InvalidOperationException("Application does not exist.");
            }

            if (app.Instance.Id != data.InstanceId)
            {
                throw new InvalidOperationException("Application does not have instance of such id.");
            }

            serviceInstance.SetApp(app);
            ThreadPool.QueueUserWorkItem(new WaitCallback(OnNewServiceInstanceAvailable), serviceInstance);
        }
Esempio n. 2
0
        void RegisterInternal(ControlRegistrationData data, UdpControlService serviceInstance)
        {
            if (this.State != CommunicationState.Opened)
            {
                return;
            }

            App app = appQueue.Lookup(data.Uri);
            if (app == null)
            {
                throw new InvalidOperationException("Application does not exist.");
            }

            if (app.Instance.Id != data.InstanceId)
            {
                throw new InvalidOperationException("Application does not have instance of such id.");
            }

            serviceInstance.SetApp(app);
            ThreadPool.QueueUserWorkItem(new WaitCallback(OnNewServiceInstanceAvailable), serviceInstance);
        }
Esempio n. 3
0
 internal static void Dispatch(ControlRegistrationData data, UdpControlService serviceInstance)
 {
     singleton.RegisterInternal(data, serviceInstance);
 }
Esempio n. 4
0
        void OnNewServiceInstanceAvailable(object state)
        {
            UdpControlService serviceInstance = (UdpControlService)state;

            serviceInstance.Dispatch();
        }
Esempio n. 5
0
 internal static void Dispatch(ControlRegistrationData data, UdpControlService serviceInstance)
 {
     singleton.RegisterInternal(data, serviceInstance);
 }