Question: Revise this client to make it a bad client where it gives poor services to the server. TCPEchoClient.java 0 import java.net.* // for Socket 1

 Revise this client to make it a bad client where it

gives poor services to the server. TCPEchoClient.java 0 import java.net.* // for

Revise this client to make it a bad client where it gives poor services to the server.

TCPEchoClient.java 0 import java.net.* // for Socket 1 import java.io.*; // for IOException and Input/OutputStream 3 public class TCPEchoClient i 5 public static void main(String[] args) throws IOException i 4 6 7 8 9 10 if ((args, length 3)) // Test for correct # of args throw new IllegalArgumentException("Parameter(s): []"); String server - args[0]; // Convert input String to bytes using the default character encoding bytel] byteBuffer-args[1].getBytes); // Server name or IP address 12 13 int servPort - (args.length-- 3)? Integer.parseInt(args[2]) :7; 15 16 // Create socket that is connected to server on specified port Socket socket - new Socket(server, servPort); System.out.println("Connected to server.. .sending echo string"); 18 19 20 21 InputStream in - socket.getInputStream); OutputStream out - socket.getOutputStream) 23 24 25 26 27 28 29 30 31 out.write (byteBuffer); // Send the encoded string to the server // Receive the same string back from the server int totalBytesRcvd 0; // Total bytes received so far int bytesRcvd; while (totalBytesRcvd 3)) // Test for correct # of args throw new IllegalArgumentException("Parameter(s): []"); String server - args[0]; // Convert input String to bytes using the default character encoding bytel] byteBuffer-args[1].getBytes); // Server name or IP address 12 13 int servPort - (args.length-- 3)? Integer.parseInt(args[2]) :7; 15 16 // Create socket that is connected to server on specified port Socket socket - new Socket(server, servPort); System.out.println("Connected to server.. .sending echo string"); 18 19 20 21 InputStream in - socket.getInputStream); OutputStream out - socket.getOutputStream) 23 24 25 26 27 28 29 30 31 out.write (byteBuffer); // Send the encoded string to the server // Receive the same string back from the server int totalBytesRcvd 0; // Total bytes received so far int bytesRcvd; while (totalBytesRcvd

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!