package com.tcp.client;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;
import java.util.Date;

public class TCPClient {

    public static void main(String args[]) {
        try {

            String message, response;
            Socket socket = new Socket("35.197.39.93", 80);

            DataOutputStream output = new DataOutputStream(socket.getOutputStream());
            BufferedReader server = new BufferedReader(
                    new InputStreamReader(socket.getInputStream())
            );

            BufferedReader reader = new BufferedReader(
                    new InputStreamReader(System.in)
            );
            message = reader.readLine() + System.lineSeparator();


            output.writeBytes(message);
            response = server.readLine();

            System.out.println("[" + new Date() + "] Received: " + response);
            socket.close();

        } catch (IOException e) {
            e.printStackTrace();
        }


    }

}

@@ -195,206 +195,549 @@
 te;%0A
-%0Apublic class TCPClient %7B%0A%0A    public static void main(String args%5B%5D) %7B%0A        try %7B%0A%0A            String message, response;%0A            S
+import java.util.concurrent.ExecutorService;%0Aimport java.util.concurrent.Executors;%0A%0Apublic class TCPClient %7B%0A%0A%09private static class TCPWorker implements Runnable %7B%0A%0A%09%09private Socket socket;%0A%09%09private String IPaddress;%0A%09%09private int port;%0A%09%09private int id;%0A%0A%09%09public TCPWorker(Socket socket, String address, int port, int id) %7B%0A%09%09%09this.s
 ocket
+ =
  socket
- = new Socket(%2235.197.39.93%22, 80);%0A%0A            
+;%0A%09%09%09this.IPaddress = address;%0A%09%09%09this.port = port;%0A%09%09%09this.id = id;%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public void run() %7B%0A%0A%09%09%09try %7B%0A%09%09%09%09for (int i = 0; i %3C 300; i++) %7B%0A%09%09%09%09%09String message, response;%0A%09%09%09%09%09
 Data
@@ -806,28 +806,21 @@
 eam());%0A
-            
+%09%09%09%09%09
 Buffered
@@ -854,37 +854,16 @@
 dReader(
-%0A                    
 new Inpu
@@ -904,188 +904,114 @@
 m())
-%0A            );%0A%0A            BufferedReader reader = new BufferedReader(%0A                    new InputStreamReader(
+);%0A%0A%09%09%09%09%09message = %22HELLO%22 + System.lineSeparator() + IPaddress + %22 %22 + port + 
 System.
+l
 in
-)%0A            );%0A            message = reader.readLine()
+eSeparator() + id
  + S
@@ -1034,29 +1034,21 @@
 tor();%0A%0A
-%0A            
+%09%09%09%09%09
 output.w
@@ -1067,28 +1067,21 @@
 ssage);%0A
-            
+%09%09%09%09%09
 response
@@ -1103,28 +1103,21 @@
 ine();%0A%0A
-            
+%09%09%09%09%09
 System.o
@@ -1174,28 +1174,26 @@
 ponse);%0A
-            
+%09%09%09%09%7D%0A%09%09%09%09
 socket.c
@@ -1201,24 +1201,19 @@
 ose();%0A%0A
-        
+%09%09%09
 %7D catch 
@@ -1234,58 +1234,479 @@
 ) %7B%0A
-            e.printStackTrace();%0A        %7D%0A%0A%0A    %7D%0A
+%09%09%09%09e.printStackTrace();%0A%09%09%09%7D%0A%0A%09%09%7D%0A%0A%09%7D%0A%0A%09public static final int N = 10;%0A%09public static ExecutorService TCP_WORKER_SERVICE = Executors.newFixedThreadPool(N);%0A%0A%09public static void main(String args%5B%5D) %7B%0A%09%09try %7B%0A%09%09%09int id;%0A%09%09%09Socket socket = new Socket(args%5B0%5D, Integer.parseInt(args%5B1%5D));%0A%09%09%09for (id = 1; id %3C= 10; id++)%0A%09%09%09%09TCP_WORKER_SERVICE.submit(new TCPWorker(socket, args%5B0%5D, Integer.parseInt(args%5B1%5D), id));%0A%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%7D
 %0A%7D%0A

Update TCPClient.java