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); }
internal static void Dispatch(ControlRegistrationData data, UdpControlService serviceInstance) { singleton.RegisterInternal(data, serviceInstance); }
void OnNewServiceInstanceAvailable(object state) { UdpControlService serviceInstance = (UdpControlService)state; serviceInstance.Dispatch(); }