Like in topic - System out and err streams seems to be "frozen" in catch clause in "update" method of Kernel class. Oddly when I am debuging the project and stop at System.out line I can even remove breakthrough and everything works correct.

Everything except last System.out is executed, it does not work even when I am replacing default System.out.

At the moment I am disconnecting user just after connection is made.

My code, StartServer.java:

```
public class StartServer {

    public static void main (String[] args) {
        Kernel kernel = new Kernel(4444);
        kernel.run();
        while (true) {
            kernel.update();
        }
    }

}

```

Kernel.java:

```
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Kernel {

    ArrayList<Socket> clients;
    ServerSocket socket;

    public Kernel(int port) {
        try {
            socket = new ServerSocket(port);
            clients = new ArrayList<>();
            System.out.println("Server initialized");
        } catch (IOException ex) {
            Logger.getLogger(StartServer.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void run() {
        Thread thread = new Thread(){
            public void run() {
                try {
                    while (true) {
                        Socket client = socket.accept();
                        clients.add(client);
                        System.out.println("New user on the server!");
                    }
                } catch (IOException ex) {
                    Logger.getLogger(Kernel.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        };
        thread.start();
    }

    public void update() {
        for (int i=0; i<clients.size(); i++) {
            Socket s = clients.get(i);
            try {
                /*String result;
                if (s.getInputStream().available()!=0) {
                    byte[] byteRes = new byte[s.getInputStream().available()];
                    char[] charRes = new char[s.getInputStream().available()];
                    s.getInputStream().read(byteRes);
                    for (int i2=0; i2<charRes.length; i2++) {
                        charRes[i2] = (char) byteRes[i2];
                    }
                    result = String.copyValueOf(charRes);
                    System.out.println(result);
                }*/
                throw new IOException();
            } catch (IOException ex) {
                try {
                    System.out.println("Client disconnected"); //working only in debug mode
                    clients.remove(s);
                    s.close();
                    i--;
                } catch (IOException ex1) {
                    Logger.getLogger(Kernel.class.getName()).log(Level.SEVERE, null, ex1);
                }
            }
        }
    }

}

```