private SocketManager()
        {
            _socketPools     = new Dictionary <SocketSettings, Dictionary <IPEndPoint, SocketPool> >(2);
            _defaultSettings = SocketClient.GetDefaultSettings();
            Dictionary <IPEndPoint, SocketPool> defaultSettingsPools = new Dictionary <IPEndPoint, SocketPool>(50);

            _sharedBufferPool = new MemoryStreamPool(_defaultSettings.InitialMessageSize, _defaultSettings.BufferReuses, SocketClient.Config.SharedPoolMinimumItems);
            _socketPools.Add(_defaultSettings, defaultSettingsPools);
        }
예제 #2
0
        internal void SetNewConfig(SocketClientConfig newConfig)
        {
            if (!newConfig.DefaultSocketSettings.SameAs(_defaultSettings))
            {
                if (log.IsInfoEnabled)
                {
                    log.Info("Default socket settings changed, updating default socket pool.");
                }

                _defaultSocketPools = GetSocketPools(newConfig.DefaultSocketSettings);
                _defaultSettings    = SocketClient.GetDefaultSettings();
            }
        }