package ru.matevosyan.server;
import java.net.*;
import java.io.*;
public class BotServer {
    public static void main(String[] ar)    {
        int port = 19999;
        try {
            ServerSocket ss = new ServerSocket(port);
            System.out.println("Waiting for a client...");

            Socket socket = ss.accept();
            System.out.println("Got a client :)!");
            System.out.println();

            try (InputStream sin = socket.getInputStream();
            OutputStream sout = socket.getOutputStream();

            DataInputStream in = new DataInputStream(sin);
            DataOutputStream out = new DataOutputStream(sout)) {

                String line = null;

                while(true) {
                    line = in.readUTF();
                    System.out.println("The dumb client just sent me this line : " + String.valueOf(line));
                    System.out.println("I'm sending it back...");
                    out.writeUTF(line);
                    out.flush();
                    System.out.println("Waiting for the next line...");
                    System.out.println();
                }

            } catch (IOException ioe) {
                ioe.getMessage();
            }

        } catch(Exception x) { x.printStackTrace(); }
    }
}
@@ -374,12 +374,8 @@
 ient
- :)!
 %22);%0A
@@ -524,24 +524,26 @@
 tStream();%0A%0A
+//
             
@@ -589,16 +589,18 @@
 m(sin);%0A
+//
         
@@ -657,16 +657,208 @@
 ut)) %7B%0A%0A
+                 PrintWriter out = new PrintWriter(socket.getOutputStream(), true);%0A                 BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))) %7B%0A%0A
         
@@ -912,24 +912,26 @@
 ile(true) %7B%0A
+//
             
@@ -955,24 +955,66 @@
 .readUTF();%0A
+                    line = in.readLine();%0A
             
@@ -1171,24 +1171,66 @@
  back...%22);%0A
+//                    out.writeUTF(line);%0A
             
@@ -1238,35 +1238,32 @@
        out.write
-UTF
 (line);%0A        

add PrintWrite and BufferedReader