Ejemplo n.º 1
0
        public ActivityWatcher(ITcpСontroller network)
        {
            _remoteToLastActive = new ConcurrentDictionary <IPEndPoint, long>();

            _network = network;
            _network.ConnectionAccepted += OnConnectionAccepted;
            _network.ConnectionClosing  += OnConnectionClosing;
            _network.PreparePacket      += OnPreparePacket;
        }
Ejemplo n.º 2
0
        public CoreApi(ITcpСontroller network, IMessageFactory messageFactory)
        {
            _logger = LogManager.GetCurrentClassLogger();

            _messageFactory = messageFactory;
            _messages       = new Dictionary <Type, HandleMessage>();
            _modules        = new List <IApiModule>();

            _network = network;
            _network.PreparePacket     += OnPreparePacket;
            _network.ConnectionClosing += OnConnectionClosing;
        }