Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java or Python Functionality You are to create a chat system. In particular, you will create a chat client and a chat server. You may

Java or Python

Functionality

You are to create a chat system. In particular, you will create a chat client and a chat server. You may use your Messenger code as a base for this project, although you will have to revise that code significantly. Notably, the client and the server must be separate programs. Your system will perform as follows:

The server will listen for connections from clients.

Once a client is connected, it can send messages to the server. It will also receive from the server all messages sent from the other connected clients.

NOTE: The first message sent by the client must be the name of the user, in order for the server to forward the name of the user with each messenge sent.

Messages must be provided to the client using standard input.

Immediately after receiving a message, the server must forward the message and the name of the user who sent the message to all connected clients, except for the client that sent the message. DO NOT SEND THE MESSAGE BACK TO THE ORIGINATING CLIENT!

The format of the combined name and message includes a colon, followed by a single space, immediately after the name of the sender; the message follows. Hence, the format can be represented as follows:

:  

Once it receives a message, which now includes the name of the sender, the client will write the message to standard output.

The client must write each message on its own line of output.

When a client closes its socket, the server will remove that client from its list, but the server will continue to run and the other connected clients will be able to continue exchanging messages. Additionally, new clients will be able to connect and exchange messages.

Usage

Server:Python:

$> python ChatServer.py  

Java:

$> java ChatServer  

Client:Python:

$> python ChatClient.py  

Java:

$> java ChatClient 

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_2

Step: 3

blur-text-image_3

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

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

b. What could be rewarding about change?

Answered: 1 week ago

Question

What Is acidity?

Answered: 1 week ago

Question

Explain the principles of delegation

Answered: 1 week ago

Question

State the importance of motivation

Answered: 1 week ago

Question

Discuss the various steps involved in the process of planning

Answered: 1 week ago

Question

What are the challenges associated with tunneling in urban areas?

Answered: 1 week ago

Question

=+j Improve the effectiveness of global and virtual teams.

Answered: 1 week ago