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
Each web site contains a(n) ____ page, which is the first document users see when they access the site.
katrin2010 [14]
Home is the answer. Hope this helps. :)
7 0
3 years ago
What is a functionalist perspective of cell phones, internet and personal computers?
Sedbober [7]
<span>As these technologies are rapidly evolving a functionalist would say that they unbalance the equilibrium of the social state, and is therefore undesirable as there is more interaction and adaptation of habits from other societies. But they also say that it's not a good thing to change immediately because it might disrupt the society. Therefore it has to change slowly. </span>
3 0
3 years ago
How do i mark a question brainliest?
Slav-nsk [51]

Answer:

You have to have 2 answers on a question.  When you find a question that is pretty reasonable, you should see a little yellow crown.  

Explanation:

Practice on this if you need :D

6 0
2 years ago
Read 2 more answers
Consider an online shopping portal that allows a customer to browse and purchase different products. There are distributed store
andrezito [222]

Answer:

Design a web page that automatically tracks the location to determine the language

Explanation:

8 0
2 years ago
Jim has listed stages of the product life cycle in his presentation which slide element can you use to make the items in the lis
IgorC [24]

jim can use bullet points.

  • this
  • is
  • an
  • example
  • of
  • bullet
  • points!
8 0
3 years ago
Other questions:
  • loop Write a program to read a list of exam scores given as integer percentages in the range 0 to 100. Display the total number
    5·1 answer
  • Systems such as smartphones, appliances, game controllers, cable set-top boxes and automobiles that contain small computers are
    5·1 answer
  • What does the binary odometer show about representing large numbers?
    8·1 answer
  • What is one of the most helpful things about having a role model?
    10·2 answers
  • Retraining is required at intervals of ___ or less.
    10·1 answer
  • Listed items that are not in any particular order should be identified with
    8·1 answer
  • The individual accountable for ensuring the day-to-day operation of the InfoSec program, accomplishing the objectives identified
    7·1 answer
  • 5. The command to add new layout to the slide is present in<br>tab.​
    15·1 answer
  • Hi there! I am writing a code to make a square using a drone, however I’m having trouble doing so. The website that I’m writing
    8·1 answer
  • A trace table is used for
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!