package com.evanram.code.java.dimchat_client_gui; import java.io.IOException; public class PrintInputStream implements Runnable { @Override public void run() { while(true) { try { String inStr = Connections.getNextInput(); if(inStr == null) //disconnect if connection's dead { Message.logError("Connection lost with server."); break; } Message.logRaw(inStr); Connections.flushOutput(); } catch(IOException e) { Message.logError("Encountered IOException when reading input next line."); break; } } Client.newConnection(); } }