Пример #1
0
        internal AsyncPeer(IApi api)
        {
            _waitingCommands = new Dictionary <string, List <WaitingCommandContainer> >();
            _packers         = new Dictionary <string, Packer>();
            _syncContext     = new EngineSyncContext();
            _requestQueue    = new RequestQueue(api);

            _diffieHellman = new ECDiffieHellmanCng(KeySize);
            _diffieHellman.KeyDerivationFunction = ECDiffieHellmanKeyDerivationFunction.Hash;
            _diffieHellman.HashAlgorithm         = CngAlgorithm.Sha256;
        }
Пример #2
0
 internal AsyncPeer(UserId id, X509Certificate2 certificate, IApi api, IClientNotifier notifier, Logger logger)
 {
     _id = id;
     _localCertificate = certificate;
     _peers            = new Dictionary <UserId, RemotePeer>();
     _syncContext      = new EngineSyncContext();
     _requestQueue     = new RequestQueue(api);
     _api      = api;
     _notifier = notifier;
     _logger   = logger;
 }
Пример #3
0
        public AsyncServer(IApi api, IServerNotifier notifier, Logger logger)
        {
            _connections = new Dictionary <string, ServerConnection>();

            _api                 = api;
            _requestQueue        = new RequestQueue(api);
            _requestQueue.Error += OnRequestQueueError;
            _notifier            = notifier;

            _isServerRunning = false;
            _logger          = logger;
        }
Пример #4
0
        public AsyncServer(X509Certificate2 certificate, IApi api, IServerNotifier notifier, Logger logger)
        {
            _connections = new Dictionary <UserId, ServerConnection>();

            _certificate         = certificate;
            _api                 = api;
            _requestQueue        = new RequestQueue(api);
            _requestQueue.Error += OnRequestQueueError;
            _notifier            = notifier;
            _bans                = new ServerBans(this);

            _isServerRunning = false;
            _logger          = logger;
        }
Пример #5
0
        public AsyncClient(UserId id, CertificatesStorage trustedCertificates, X509Certificate2 certificate, IApi api, IClientNotifier notifier, Logger logger)
            : base(trustedCertificates, certificate, logger)
        {
            Id = id;

            _api                 = api;
            _requestQueue        = new RequestQueue(api);
            _requestQueue.Error += OnRequestQueueError;
            _notifier            = notifier;

            _reconnect    = true;
            _reconnecting = false;
            _logger       = logger;
        }
Пример #6
0
        public AsyncClient(string id, IApi api, IClientNotifier notifier, Logger logger)
        {
            Id = id;

            _api                 = api;
            _requestQueue        = new RequestQueue(api);
            _requestQueue.Error += OnRequestQueueError;
            _notifier            = notifier;

            _timer        = new Timer(OnTimer, null, SystemTimerInterval, -1);
            _reconnect    = true;
            _reconnecting = false;
            _logger       = logger;
        }
Пример #7
0
 public QueueContainer(RequestQueue queue)
 {
     _queue = queue;
 }
Пример #8
0
 public QueueContainer(RequestQueue <TArgs> queue)
 {
     this.queue = queue;
 }