@Override
    public void run() {
        listener.onStatusChanged(NetworkListener.ON_CONNECT, null);
        while (true) {
            try {
                final int status = dis.readInt();
                switch (status) {
                    case NetworkListener.ON_SEED_RECEIVED:
                    case NetworkListener.ON_NEW_ROUND:
                        listener.onStatusChanged(status, receiveSeed());
                        break;
                    case NetworkListener.ON_MOVE_RECEIVED:
                        listener.onStatusChanged(status, receiveMove());
                        break;
                }
            } catch (IOException ex) {
                ExceptionHandler.handle(ex);
                listener.onStatusChanged(NetworkListener.ON_DISCONNECT, null);
                break;
            }
            try {
                Thread.sleep(200);
            } catch (InterruptedException ex) { }
        }
    }