Question
I have a question about writing a chat java program that uses server and client side, it is supposed to be two seperate files. The
I have a question about writing a chat java program that uses server and client side, it is supposed to be two seperate files. The instructions are below and they are very detailed. I do understand them however I cannot translate written description to code and I'm totally confused. Would appreciate it if someone can help me out! Write both a Client and a Server chat program in Java. The Server Program: The Server will begin listening on port 18888. The Server will display the message Waiting for Client on the Screen. As soon as the client connects to the Server. The Server will send the following message to the Client. You are Now Connected. The Server program will then wait to receive the first string from the Client program. The Server will then prompt the user to enter a string from the keyboard and it will be sent to the Client. The Server will wait for the client to send a string. When it is received, it will be displayed on the screen. Put the words Sent from Client: in front of the message received. The Server and the Client will have a conversation. They will take turns sending and receiving messages. The conversation will continue until the user enters the word quit (from either the Server or the Client). After the word quit is received, the Server will display on the screen Connection Closed and the Server will close all resources. The word quit will be all lower case. Note: The Server must NOT be in an endless loop. The Client Program: The Client will connect to the Server program using IP 127.0.0.1 and port 18888. The Client will wait for the message You are Now Connected that will be sent from the Server. The Client user will enter a string from the keyboard and the string will be sent to the Server. (Therefore the client will send the first keyboard string) The Client and Server will then take turns sending/receiving strings from each other. Remember they are polite. When a message is received from the Server it will be displayed on the screen. Put the words Sent from Server: in front of the message received. The conversation will continue until the user enters the word quit (from either the Server or the Client). After the word quit is received, the Server will display on the screen Connection Closed and the Client will close all resources. The word quit will be all lower case. Thanks
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