1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
alexira [117]
3 years ago
11

Design a program using ordinary pipes in which one process sends a string message to a second process, and the second process re

verses the case of each character in the message and sends it back to the first process. for example, if the first process sends the message hi there, the second process will return hi there. this will require using two pipes, one for sending the original message from the first to the second process and the other for sending the modified message from the second to the first process. you can write this program using either unix or windows pipes.
Computers and Technology
1 answer:
Dmitry [639]3 years ago
5 0

Here's a solution in C#. Create two console applications, one for the client and one for the server. In the server, put this:

           Console.WriteLine("Listening to pipe...");

           var server = new NamedPipeServerStream("BrainlyPipe");

           server.WaitForConnection();

           var reader = new StreamReader(server);

           var writer = new StreamWriter(server);

           while (true)

           {

               var line = reader.ReadLine();

               if (!server.IsConnected) break;

               Console.WriteLine("Received: " + line);

               writer.WriteLine(ChangeCase(line));

               writer.Flush();

           }

To change case, add this function:

       public static string ChangeCase( string s)

       {

           var sb = new StringBuilder();

           foreach(char c in s)

               sb.Append(char.IsUpper(c) ? char.ToLower(c) : char.ToUpper(c));

           return sb.ToString();

       }

In the client, put this:

           var client = new NamedPipeClientStream("BrainlyPipe");

           client.Connect();

           var reader = new StreamReader(client);

           var writer = new StreamWriter(client);

           writer.WriteLine("Brainly question 13806153 demo");

           writer.Flush();

           Console.WriteLine(reader.ReadLine());

           Console.ReadLine();


You might be interested in
Which of the following is considered to be open-end credit?
tia_tia [17]

Department store charge cards are considered open-end credit, so the answer is C.

4 0
3 years ago
Read 2 more answers
When both gears are the same size what will they produce
djverab [1.8K]

They produce a 1:1 ratio.  The input power is equal to the output power.

7 0
4 years ago
What are the two types of programming languages?
ddd [48]

Answer:

High level language.

Low level language

Explanation:

please give brainliest

3 0
3 years ago
HELPPP ME PLEASEEE!!
natita [175]
It’s the last one! The key to an effective persuasion is to know what you want and be clear about your response.
4 0
3 years ago
Which of the following is the fastest processor
Nookie1986 [14]
Usually a Xeon is the fastest. Matters what time it was built and the chipset. If its old, the i7 is faster.
6 0
3 years ago
Other questions:
  • How to create a delete button in Python?
    15·1 answer
  • J'Dean is a team lead at a car wash. He wrote a memo to the employees, explaining some upcoming promotions, but J'Dean didn't fu
    6·2 answers
  • Write a function named max that accepts two integer values as arguments and returns the value that is the greater of the two. Fo
    12·1 answer
  • What is the benefit of making an archive folder visible in the Outlook folder list?
    6·1 answer
  • How to delete the last element in array
    15·1 answer
  • Why do some people have random numbers as their usernames?
    9·2 answers
  • suspect that several users are attempting to install unauthorized software. Upon researching, you discover that the attempts wer
    12·1 answer
  • A related database stores data in the form of______
    15·1 answer
  • What are the two different types of dns requests?
    5·2 answers
  • ___________________ describes the process of combining voice, video, and data communications over a common network infrastructur
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!