Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions

Question

Understand discrimination based on ethnicity

Answered: 1 week ago

Question

Explain the steps involved in training programmes.

Answered: 1 week ago