Question: you have been challenged to create a custom chat application that allows two to communicate by sending message to each other using a Socket and
you have been challenged to create a custom chat application that allows two to communicate by sending message to each other using a Socket and serverSocket in java. The application should have the following key feature: The server must listen on a designed port for connections from client. Once a client connect the server must establish input and output streams for the socket and wait for incoming message. The server must print received message to be console and forward them to the other connector client. The client must connect to the server using the Socket class, set up input and output streams for the socket, and send message to the server. The client display message received from the server on its console. The application must be able to handle disconnections and terminate the socket and streams in a graceful manner. Note: to test the clients you can run instance of the client program on the same device using separate terminal windows. Your code should have proper error handling and adhere to programming best practices. You can use additional libraries but make sure to document them. Your solutions should be original welldocument them. Your solution should be original welldocumented, and clearly written. can you fulfill change and provide a unique solution for a chat application that meets these requirements
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
