Exemplo n.º 1
0
        /// <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();
        }
Exemplo n.º 2
0
        /// <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();
        }