コード例 #1
0
 internal MQChannelListEntry()
 {
     base.TrConstructor("%Z% %W%  %I% %E% %U%");
     this.next              = null;
     this.name              = null;
     this.useCount          = 0;
     this.updateRequired    = false;
     this.totalWeight       = 0;
     this.channelFile       = null;
     this.modTime           = 0L;
     this.alphaEntry        = null;
     this.thisAlphaEntry    = null;
     this.weightedEntry     = null;
     this.thisWeightedEntry = null;
 }
コード例 #2
0
        public void CreateChannelEntryLists(MQChannelListEntry nameList)
        {
            uint method = 0x31;

            this.TrEntry(method, new object[] { nameList });
            try
            {
                if (this.tableStream == null)
                {
                    this.GetStream();
                }
                else
                {
                    this.tableStream.Seek(0L, SeekOrigin.Begin);
                }
                if (this.Readuint(this.tableStream) != 0x52514d41)
                {
                    base.throwNewMQException(2, 0x8e6);
                }
                MQChannelDefinition channel = null;
                bool   flag   = false;
                byte[] buffer = null;
                int    num6   = this.FindFirstChannel(this.tableStream);
                while (!flag)
                {
                    this.tableStream.Seek((long)num6, SeekOrigin.Begin);
                    if (this.Readuint(this.tableStream) == 0)
                    {
                        flag = true;
                        break;
                    }
                    uint num4 = this.Readuint(this.tableStream);
                    this.Readuint(this.tableStream);
                    this.Readuint(this.tableStream);
                    uint num5 = this.Readuint(this.tableStream);
                    if (num5 != 0)
                    {
                        num6 = (int)num5;
                    }
                    else
                    {
                        flag = true;
                    }
                    if ((buffer == null) || (num4 > buffer.Length))
                    {
                        buffer = new byte[num4];
                    }
                    int length = this.tableStream.Read(buffer, 0, (int)num4);
                    channel = new MQChannelDefinition(buffer, 0, length);
                    bool   flag2 = true;
                    string name  = null;
                    base.TrText(method, "Qmgr name suppled " + nameList.Name);
                    if (((nameList.Name != null) && (nameList.Name != "*")) && (nameList.Name != string.Empty))
                    {
                        base.TrText(method, "Qmgr name suppled " + nameList.Name);
                        name = nameList.Name;
                    }
                    if (name != null)
                    {
                        Encoding.ASCII.GetString(channel.QMgrName).Trim();
                        if (name.StartsWith("*") && (name.Length > 1))
                        {
                            name = name.Substring(1);
                            base.TrText(method, "Qmgr name being used by nmqi : " + name);
                        }
                        byte[] buffer2 = new byte[0x30];
                        base.GetBytesRightPad(name, ref buffer2);
                        for (int i = 0; i < 0x30; i++)
                        {
                            if (buffer2[i] != channel.QMgrName[i])
                            {
                                flag2 = false;
                                break;
                            }
                        }
                    }
                    base.TrText(method, "Did we find a matching channel definition from ccdt ? " + flag2);
                    if (flag2)
                    {
                        if ((nameList.Name != null) && nameList.Name.StartsWith("*"))
                        {
                            base.TrText(method, "Qmgr name suppled has * in it.. Found the cd having it. Setting qmgr name as blank in it.");
                            byte[] qMgrName = channel.QMgrName;
                            base.GetBytesRightPad(string.Empty, ref qMgrName);
                            channel.QMgrName = qMgrName;
                        }
                        if (channel.Version < 9)
                        {
                            channel.SharingConversations  = 0;
                            channel.PropertyControl       = 0;
                            channel.MaxInstances          = 0x3b9ac9ff;
                            channel.MaxInstancesPerClient = 0x3b9ac9ff;
                            channel.ClientChannelWeight   = 0;
                            channel.ConnectionAffinity    = 0;
                            nameList.AddChannelEntry(channel);
                            break;
                        }
                        nameList.AddChannelEntry(channel);
                    }
                }
                if (nameList.WeightedEntry != null)
                {
                    nameList.OrderWeightedChannelEntry();
                }
                nameList.ThisAlphaEntry    = nameList.AlphaEntry;
                nameList.ThisWeightedEntry = nameList.WeightedEntry;
            }
            catch (MQException)
            {
                throw;
            }
            catch (IOException exception)
            {
                base.TrException(method, exception, 1);
                throw exception;
            }
            catch (Exception exception2)
            {
                base.TrException(method, exception2, 2);
                base.TrException(method, exception2);
                base.throwNewMQException(2, 0x8e6);
            }
            finally
            {
                base.TrExit(method);
            }
        }