Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The purpose of this lab is to become familiar with working with sockets. You wil

ID: 3641424 • Letter: T

Question

The purpose of this lab is to become familiar with working with sockets.
You will write a client/server network program that allows a simple conversation to take place between two computers.
1. Write a program named TalkServer that uses a ServerSocket object
to listen for clients on port 5050.
2. When a client connects, have the TalkServer program read in a
String from the client using the readUTF() method of the DataInputStream class. You will need to create a new DataInputStream by
using the input stream of the socket. Print out the String that is read.
3. The TalkServer program should then send a String to the client
using the writeUTF() method of the DataOutputStream class, sending the String to the client’s socket. The string sent to the client
should be input from the console input using the keyboard.
4. This process should continue until the connection is lost somehow.
In other words, the TalkServer reads in a String, displays it, and
then inputs a String from the keyboard and sends it to the client.
5. Write a program named TalkClient that uses the Socket class to connect to the server socket of the TalkServer program.
6. The client should send a String input from the keyboard to the
server using the writeUTF() method. Then, the TalkClient should
read in a String from the Server using the readUTF() method, displaying the String.
Network Programming 621
c423149 Ch17.qxd 6/30/03 9:44 AM Page 6217. This process should continue until the connection is lost. The client
and server are now communicating with each other in a simple
conversation.
The initial output of the server should be a String read from the client.
The initial output on the client should be a prompt to enter a message to
be sent to the server. When the client enters a message and presses Enter,
the message should be displayed on the server. Similarly, when a message is entered on the server and the user presses Enter, the message
should be displayed on the client.

Explanation / Answer

I will post the solution later so you can rate it before it expires. Just give Need Work for now.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote