Exemple #1
0
        public ConnectionManager(string configPath, CoreManager coreManager, BufferManager bufferManager)
        {
            _bufferManager           = bufferManager;
            _coreManager             = coreManager;
            _catharsisManager        = new CatharsisManager(Path.Combine(configPath, "Catharsis"), _bufferManager);
            _tcpConnectionManager    = new TcpConnectionManager(Path.Combine(configPath, "TcpConnection"), _catharsisManager, _bufferManager);
            _i2pConnectionManager    = new I2pConnectionManager(Path.Combine(configPath, "I2pConnection"), _bufferManager);
            _customConnectionManager = new CustomConnectionManager(Path.Combine(configPath, "CustomConnection"), _catharsisManager, _bufferManager);

            _coreManager.ConnectCapEvent = (_, uri) => this.ConnectCap(uri);
            _coreManager.AcceptCapEvent  = (object _, out string uri) => this.AcceptCap(out uri);

            _watchTimer = new WatchTimer(this.WatchThread);
        }
Exemple #2
0
        public MessageManager(string configPath, CoreManager coreManager, BufferManager bufferManager)
        {
            _bufferManager = bufferManager;
            _coreManager   = coreManager;

            _settings = new Settings(configPath);

            _cache_Profiles     = new VolatileHashDictionary <BroadcastMetadata, BroadcastMessage <Profile> >(new TimeSpan(0, 30, 0));
            _cache_Stores       = new VolatileHashDictionary <BroadcastMetadata, BroadcastMessage <Store> >(new TimeSpan(0, 30, 0));
            _cache_MailMessages = new VolatileHashDictionary <Signature, LockedHashDictionary <UnicastMetadata, UnicastMessage <MailMessage> > >(new TimeSpan(0, 30, 0));
            _cache_ChatMessages = new VolatileHashDictionary <Tag, LockedHashDictionary <MulticastMetadata, MulticastMessage <ChatMessage> > >(new TimeSpan(0, 30, 0));

            _watchTimer = new WatchTimer(this.WatchTimer);
            _watchTimer.Start(new TimeSpan(0, 0, 30));

            _coreManager.GetLockSignaturesEvent = (_) => this.Config.SearchSignatures;
        }