Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var pipe = PipeHelper.CreateClient(PipeNames.Reciever);

            var reader = new StreamReader(pipe);

            while (true)
            {
                Console.Write("How many messages to recieve: ");

                var input = Console.ReadLine();

                if (!int.TryParse(input, out int messageCount))
                {
                    Console.Write("Thats not a number, dummy...");
                    continue;
                }

                for (var x = 0; x < messageCount; x++)
                {
                    var message = reader.ReadLine();
                    Console.WriteLine($"Message {x + 1}: {message}");
                }
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var pipe = PipeHelper.CreateClient(PipeNames.Sender);

            var writer = new StreamWriter(pipe);

            while (true)
            {
                Console.Write("Type your message: ");
                var message = Console.ReadLine();

                Console.WriteLine($"Sending: {message}");

                writer.WriteLine(message);
                writer.Flush();

                Console.WriteLine($"Message Sent!");
            }
        }