public virtual void setAsyncOpsWindow(int maxOpsInvoked, int maxOpsPerformed)
 {
     if (maxOpsInvoked == 1 && maxOpsPerformed == 1)
     {
         aow = null;
     }
     else if (aow == null || aow.MaxOpsInvoked != maxOpsInvoked || aow.MaxOpsPerformed != maxOpsPerformed)
     {
         aow = new AsyncOpsWindow(maxOpsInvoked, maxOpsPerformed);
     }
 }
        private AsyncOpsWindow NegotiateAOW(AsyncOpsWindow offered)
        {
            if (offered == null)
                return null;

            if (aow == null)
                return AsyncOpsWindow.DEFAULT;

            return new AsyncOpsWindow(minAOW(offered.MaxOpsInvoked, aow.MaxOpsInvoked), minAOW(offered.MaxOpsPerformed, aow.MaxOpsPerformed));
        }
        private void ReadUserInfo(ByteBuffer bb, int len)
        {
            int diff = len - (int)bb.Remaining;
            if (diff != 0)
            {
                throw new PduException("User info item length=" + len + " mismatch Pdu length (diff=" + diff + ")", new AAbort(AAbort.SERVICE_PROVIDER, AAbort.INVALID_PDU_PARAMETER_VALUE));
            }

            while ( bb.Remaining > 0  )
            {
                int subItemType = bb.ReadByte();
                bb.Skip();
                int itemLen = bb.ReadInt16();
                switch (subItemType)
                {
                    case 0x51:
                        if (itemLen != 4)
                        {
                            throw new PduException("Illegal length of Maximum length sub-item: " + itemLen, new AAbort(AAbort.SERVICE_PROVIDER, AAbort.INVALID_PDU_PARAMETER_VALUE));
                        }
                        maxLength = bb.ReadInt32();
                        break;

                    case 0x52:
                        ClassUID = bb.ReadString(itemLen);
                        break;

                    case 0x53:
                        asyncOpsWindow = new AsyncOpsWindow(bb, itemLen);
                        break;

                    case 0x54:
                        AddRoleSelection(new RoleSelection(bb, itemLen));
                        break;

                    case 0x55:
                        VersionName = bb.ReadString(itemLen);
                        break;

                    case 0x56:
                        AddExtNegotiation(new ExtNegotiation(bb, itemLen));
                        break;

                    default:
                        throw new PduException("unrecognized user sub-item type " + System.Convert.ToString(subItemType, 16) + 'H', new AAbort(AAbort.SERVICE_PROVIDER, AAbort.UNRECOGNIZED_PDU_PARAMETER));
                }
            }
        }