For this question you will be creating and writing Chat serverfi'client program. The Server will be responsible formaintaininglists ofwho is connected clients will be able to query this list. The server will be responsible forforwarding messages betweenclients. Clients will be able to either broadcast message (to everyone), or send message to specific individual. Server The serveris responsible for allowing clients to register, query for existing clients, and deregister. It also handles forwarding messages as needed Starting the Server You shouldn’t needto do anything special here. Make sure you do not hardcode port, but let your server socket choose an openport. Make sure you at the very least print out which port it is listening on, so you know how to set up the clients to connect Client The client code will involve opening socket whenit needs to connect to the server (registration, ask for connected users, deregister). It will also need to continue listening on this socket for any messages that come through, and make sure to print it to the command line. While all this fun is going on, your client will also need to interact withyou:waiting for registration/’deregistration commands, request for list of all connected users, and then actually sending!receiving messages either toffromthe group or directly tor'from user. The interactive client commands will be discussed in later section. After client has registered, asked for, thenreceived list ofregistered users, there are only few specific wire formats needed for communication: For broadcast messages, clients will need to send (as well as receive) BROADCAST_MESSAGEs: Starting vour client 0n startup, make sure to give your client code the information needed to find the server! (IP address, port). You should also give it user name when you register! Should an error in registration occur (can’t connect to server, username already in use) X93; program should exit after informing the user what went wrong.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

For this question you will be creating and writing Chat serverfi'client program. The Server will be
responsible formaintaininglists ofwho is connected clients will be able to query this list. The server will
be responsible forforwarding messages betweenclients. Clients will be able to either broadcast message
(to everyone), or send message to specific individual.
Server
The serveris responsible for allowing clients to register, query for existing clients, and deregister. It also
handles forwarding messages as needed
Starting the Server
You shouldn’t needto do anything special here. Make sure you do not hardcode port, but let your server
socket choose an openport. Make sure you at the very least print out which port it is listening on, so you
know how to set up the clients to connect
Client
The client code will involve opening socket whenit needs to connect to the server (registration, ask for
connected users, deregister). It will also need to continue listening on this socket for any messages that
come through, and make sure to print it to the command line. While all this fun is going on, your client will
also need to interact withyou:waiting for registration/’deregistration commands, request for list of all
connected users, and then actually sending!receiving messages either toffromthe group or directly tor'from
user. The interactive client commands will be discussed in later section.
After client has registered, asked for, thenreceived list ofregistered users, there are only few specific
wire formats needed for communication:
For broadcast messages, clients will need to send (as well as receive) BROADCAST_MESSAGEs:
Starting vour client
0n startup, make sure to give your client code the information needed to find the server!
(IP address, port). You should also give it user name when you register!
Should an error in registration occur (can’t connect to server, username already in use) X93; program
should exit after informing the user what went wrong.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Hyperlinks
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education