Beispiel #1
0
        private static FbServerConfig ParseServerConfig(byte[] buffer, ref int pos)
        {
            FbServerConfig config = new FbServerConfig();

            pos = 1;
            while (buffer[pos] != IscCodes.isc_info_flag_end)
            {
                pos++;

                int key      = buffer[pos - 1];
                int keyValue = IscHelper.VaxInteger(buffer, pos, 4);

                pos += 4;

                switch (key)
                {
                case IscCodes.ISCCFG_LOCKMEM_KEY:
                    config.LockMemSize = keyValue;
                    break;

                case IscCodes.ISCCFG_LOCKSEM_KEY:
                    config.LockSemCount = keyValue;
                    break;

                case IscCodes.ISCCFG_LOCKSIG_KEY:
                    config.LockSignal = keyValue;
                    break;

                case IscCodes.ISCCFG_EVNTMEM_KEY:
                    config.EventMemorySize = keyValue;
                    break;

                case IscCodes.ISCCFG_PRIORITY_KEY:
                    config.PrioritySwitchDelay = keyValue;
                    break;

                case IscCodes.ISCCFG_MEMMIN_KEY:
                    config.MinMemory = keyValue;
                    break;

                case IscCodes.ISCCFG_MEMMAX_KEY:
                    config.MaxMemory = keyValue;
                    break;

                case IscCodes.ISCCFG_LOCKORDER_KEY:
                    config.LockGrantOrder = keyValue;
                    break;

                case IscCodes.ISCCFG_ANYLOCKMEM_KEY:
                    config.AnyLockMemory = keyValue;
                    break;

                case IscCodes.ISCCFG_ANYLOCKSEM_KEY:
                    config.AnyLockSemaphore = keyValue;
                    break;

                case IscCodes.ISCCFG_ANYLOCKSIG_KEY:
                    config.AnyLockSignal = keyValue;
                    break;

                case IscCodes.ISCCFG_ANYEVNTMEM_KEY:
                    config.AnyEventMemory = keyValue;
                    break;

                case IscCodes.ISCCFG_LOCKHASH_KEY:
                    config.LockHashSlots = keyValue;
                    break;

                case IscCodes.ISCCFG_DEADLOCK_KEY:
                    config.DeadlockTimeout = keyValue;
                    break;

                case IscCodes.ISCCFG_LOCKSPIN_KEY:
                    config.LockRequireSpins = keyValue;
                    break;

                case IscCodes.ISCCFG_CONN_TIMEOUT_KEY:
                    config.ConnectionTimeout = keyValue;
                    break;

                case IscCodes.ISCCFG_DUMMY_INTRVL_KEY:
                    config.DummyPacketInterval = keyValue;
                    break;

                case IscCodes.ISCCFG_IPCMAP_KEY:
                    config.IpcMapSize = keyValue;
                    break;

                case IscCodes.ISCCFG_DBCACHE_KEY:
                    config.DefaultDbCachePages = keyValue;
                    break;
                }
            }

            pos++;

            return(config);
        }
		private static FbServerConfig ParseServerConfig(byte[] buffer, ref int pos)
		{
			FbServerConfig config = new FbServerConfig();

			pos = 1;
			while (buffer[pos] != IscCodes.isc_info_flag_end)
			{
				pos++;

				int key = buffer[pos - 1];
				int keyValue = IscHelper.VaxInteger(buffer, pos, 4);

				pos += 4;

				switch (key)
				{
					case IscCodes.ISCCFG_LOCKMEM_KEY:
						config.LockMemSize = keyValue;
						break;

					case IscCodes.ISCCFG_LOCKSEM_KEY:
						config.LockSemCount = keyValue;
						break;

					case IscCodes.ISCCFG_LOCKSIG_KEY:
						config.LockSignal = keyValue;
						break;

					case IscCodes.ISCCFG_EVNTMEM_KEY:
						config.EventMemorySize = keyValue;
						break;

					case IscCodes.ISCCFG_PRIORITY_KEY:
						config.PrioritySwitchDelay = keyValue;
						break;

					case IscCodes.ISCCFG_MEMMIN_KEY:
						config.MinMemory = keyValue;
						break;

					case IscCodes.ISCCFG_MEMMAX_KEY:
						config.MaxMemory = keyValue;
						break;

					case IscCodes.ISCCFG_LOCKORDER_KEY:
						config.LockGrantOrder = keyValue;
						break;

					case IscCodes.ISCCFG_ANYLOCKMEM_KEY:
						config.AnyLockMemory = keyValue;
						break;

					case IscCodes.ISCCFG_ANYLOCKSEM_KEY:
						config.AnyLockSemaphore = keyValue;
						break;

					case IscCodes.ISCCFG_ANYLOCKSIG_KEY:
						config.AnyLockSignal = keyValue;
						break;

					case IscCodes.ISCCFG_ANYEVNTMEM_KEY:
						config.AnyEventMemory = keyValue;
						break;

					case IscCodes.ISCCFG_LOCKHASH_KEY:
						config.LockHashSlots = keyValue;
						break;

					case IscCodes.ISCCFG_DEADLOCK_KEY:
						config.DeadlockTimeout = keyValue;
						break;

					case IscCodes.ISCCFG_LOCKSPIN_KEY:
						config.LockRequireSpins = keyValue;
						break;

					case IscCodes.ISCCFG_CONN_TIMEOUT_KEY:
						config.ConnectionTimeout = keyValue;
						break;

					case IscCodes.ISCCFG_DUMMY_INTRVL_KEY:
						config.DummyPacketInterval = keyValue;
						break;

					case IscCodes.ISCCFG_IPCMAP_KEY:
						config.IpcMapSize = keyValue;
						break;

					case IscCodes.ISCCFG_DBCACHE_KEY:
						config.DefaultDbCachePages = keyValue;
						break;
				}
			}

			pos++;

			return config;
		}