Question: C++ PROGRAMMING FOR DATA COMMUNICATIONS PART A [2.0 marks] Update the servers source code in order for it to act as the remote chat room.

C++ PROGRAMMING FOR DATA COMMUNICATIONS

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

C++ PROGRAMMING FOR DATA COMMUNICATIONS PART A [2.0 marks] Update the servers

PART A - [2.0 marks] Update the server's 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 client's 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. PART A - [2.0 marks] Update the server's 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 client's 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!