Question
Consider the following programs: -server.c ( https://ufile.io/r6578 ) -client.c ( https://ufile.io/l2jna ) Server can connect with multiple clients. The goal is to extend the client
Consider the following programs: -server.c ( https://ufile.io/r6578 ) -client.c ( https://ufile.io/l2jna ) Server can connect with multiple clients.
The goal is to extend the client / server application and convert it into a chat room using shared memory.
- Server Process Expand the function of the server program so that the affiliate processes use shared memory to create a shared circular buffer where the messages will be placed. Shared memory will be generated by the parent process and will be accessible from affiliate processes. Each affiliate process expects a message from the customer with a timeout of i (timeout) for 1 second. If it receives a message, it will place it in the buffer. When the end of time occurs, it will send the client all the cached messages that have not yet been sent to the client.
- Client Process Modify the client code so that it waits either for user input or for a message from the server. When the user enters some text it will be sent to the server. If the server sends a message, it will appear on the client screen. The process can use multiplex (call select) to determine whether a message has been sent from the server or the user. Note: Server-client communication becomes asynchronous in this way.
The answer should be based to the above programs (sever.c / client.c).
The links are working. Ignore the parenthesis.
Copy-paste the links to your browser. Then wait 5sec and select slow download.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started