Пример #1
0
        public TcpServerTests()
        {
            _serverAddress = new IPEndPoint(new IPAddress(new byte[] {127, 0, 0, 1}), 9123);
            // _serverAddress = new IPEndPoint(IPAddress.Any, 9123);

            _server = new TcpServer(_serverAddress, new MockProcessor());
            _server.StartListening();
        }
Пример #2
0
        /// <summary>
        /// Creates CommunicationServer instance.
        /// </summary>
        /// <param name="config">Server configuration.</param>
        public CommunicationServer(ServerConfig config)
        {
            // TODO Communication server should be a backup by default. Some work is needed here.

            Config = config;

            _componentOverseer = new ComponentOverseer(Config.CommunicationTimeout, ComponentOverseerCheckInterval);
            _workManager = new WorkManager(_componentOverseer);
            _msgProcessor = new MessageProcessor(_componentOverseer, _workManager);
            _tcpServer = new TcpServer(Config.Address, _msgProcessor);
        }