Question
PART A [2.0 marks] Update the servers source code in order for it to act as the remote chat room. It should be able to
PART A [2.0 marks] Update the servers source code in order for it to act as the remote chat room. It should be able to accept up to 20 concurrent connections, receive messages from any one of those connections, and broadcast the received messages to all users. There is no need to identify the senders of each message. Hint: Modify the Run function to send back messages to all active connections.
PART B [3.0 marks] Update the clients source code in order for it to communicate with a remote chat room. The remote server expects a client to connect, receive a Welcome message, and start sending messages. After receiving a message from one user, the server broadcasts it to all other users that are currently connected. Therefore, after connecting, your client should open a thread to send messages, and another one to listen and print incoming messages from the server. Hint: Create a tx thread that will be used for calling a function to send messages, and a detached thread to call a function to receive messages. Make sure to use .join() on the tx thread to keep your client running. It is OK if your client receives a number of bogus messages from the server upon quitting
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