Exemple #1
0
        public void Run()
        {
            int port = _view.ReadInputPortNumber();

            _client = new Client.Client <User>(port);
            _client.Listen(message => _view.PrintMessage(message.ToString()));
            Console.ReadKey();
        }
Exemple #2
0
        public void Run()
        {
            IPAddress ip   = _view.ReadInputIpAddress();
            int       port = _view.ReadInputPortNumber();

            _server = new Server.Server <User>(ip, port);

            string message;

            do
            {
                message = _view.ReadMessage();

                User user = new User();

                user.Name    = message;
                user.Surname = "Vettel";

                _server.Send(user);
            } while (!IsExitInput(message));
        }