Esempio n. 1
0
        public override void Close()
        {
            uint method = 0x2d7;

            this.TrEntry(method);
            try
            {
                if (this.unmanagedDestinationReference != null)
                {
                    base.isClosed = true;
                    if (this.subscriptionReference != null)
                    {
                        this.subscriptionReference.Close();
                        this.subscriptionReference = null;
                    }
                }
                else
                {
                    base.Close();
                    if (this.subscriptionReference != null)
                    {
                        if ((this.subscriptionReference.objectHandle != null) && (this.subscriptionReference.objectHandle.HOBJ.Handle != -1))
                        {
                            this.subscriptionReference.Close();
                        }
                        this.subscriptionReference = null;
                    }
                }
                base.qMgr = null;
            }
            finally
            {
                base.TrExit(method);
            }
        }
Esempio n. 2
0
        private void OpenForSubscription(MQDestination destination, string topicName, string subscriptionName, Hashtable parameters)
        {
            uint method = 0x2d2;

            this.TrEntry(method, new object[] { destination, topicName, subscriptionName, parameters });
            try
            {
                int openOptions = base.OpenOptions;
                this.subscribed = true;
                if (destination == null)
                {
                    base.objectHandle = MQQueueManager.nmqiEnv.NewPhobj();
                }
                else
                {
                    base.objectHandle = destination.objectHandle;
                }
                this.unmanagedDestinationReference = destination;
                bool flag  = (openOptions & 8) == 8;
                bool flag2 = (subscriptionName != null) && (subscriptionName.Length > 0);
                this.durable = flag && flag2;
                bool flag3 = (openOptions & 0x20) == 0x20;
                bool flag4 = destination == null;
                this.managed = flag3 | flag4;
                if (flag4)
                {
                    base.OpenOptions |= 0x20;
                }
                MQSubscriptionDescriptor mqSD = this.CreateMQSubscriptionDescriptor(topicName, subscriptionName, parameters);
                this.subscriptionReference = new MQSubscription(base.qMgr, this, mqSD);
                base.hObj = base.objectHandle.HOBJ;
                bool isOpen = this.subscriptionReference.IsOpen;
                base.isClosed = !isOpen;
            }
            finally
            {
                base.TrExit(method);
            }
        }