Question: Client / Server using named pipes with thread and fork() in C/C++ **Note** You will need to write a client program and a server program
Client / Server using named pipes with thread and fork() in C/C++
**Note** You will need to write a client program and a server program for this question to be correct. **
**Cannot use socket**
client
the client application that will get the command from the user and pass the command to be executed from the command line, parses the command and puts a binary representation of the parse into a shared memory segment. At this point, the client will listen on the read size of a named pipe to get the output from the command. Display this information on standard output.
server
the server application will listen for requests from clients in shared memory, process these requests when it receives them from the client, and return data back to the client over the connection. The server must be able to handle multiple connections at the same time.
The client and server need to communicate with each other using shared memory and named pipes. For each new request in shared memory, the server should start up a new thread. This thread will need to start a new thread for each command; this thread will need to use fork() and exec() to launch the new process for the command to be executed. You will need to keep track of which client has started the connection (the contents of the shared memory will need to include an indication of which client started the process).
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
