/// <summary> /// Initializes an instance of the SirenaClientPool class. /// </summary> /// <param name="poolSize">The Sirena client maximum pool size.</param> /// <param name="clientSettings">The settings that will be applied during communication.</param> public SirenaClientPool(Int32 poolSize, SirenaClientSettings clientSettings) { if (poolSize <= 0 || poolSize > Int32.MaxValue) { throw new ArgumentOutOfRangeException("poolSize"); } if (clientSettings == null) { throw new ArgumentNullException("clientSettings can not be null"); } this.clientSettings = clientSettings; clients = new ConcurrentQueue <SirenaClient>(); ClientPoolSize = poolSize; InitializeClients(); }
/// <summary> /// Initializes an instance of the SirenaClient class. /// </summary> /// <param name="clientSettings">The settings that will be applied during communication.</param> public SirenaClient(SirenaClientSettings clientSettings) { if (clientSettings == null) { throw new ArgumentNullException("clientSettings can not be null"); } Id = Guid.NewGuid(); desCryptography = DESCryptography.Instance; rsaCryptography = new RSACryptography(); this.clientSettings = clientSettings; client = new TcpClient(); }