@Override public void run() { if (connection == null) { connection = connector.connect(); } input = connection.getInput(); reader = new BufferedReader(new InputStreamReader(input)); keepReading(); }
/** * Suorittaa connectorin varaamisen synkronisesti. * * @param connector */ public void start(ConnectionStrategy connector) { this.connector = connector; this.connection = connector.connect(); super.start(); // Aloitetaan thread kun alkuvalmistelut on tehty }