public ActivityWatcher(ITcpСontroller network) { _remoteToLastActive = new ConcurrentDictionary <IPEndPoint, long>(); _network = network; _network.ConnectionAccepted += OnConnectionAccepted; _network.ConnectionClosing += OnConnectionClosing; _network.PreparePacket += OnPreparePacket; }
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; }