import de.hacksaar.javatuer.InteractiveLogin;
import de.hacksaar.javatuer.TyshellClient;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.Queue;
}
}
+ private void readUnlimited(InputStreamReader inputStreamReader) {
+ final BufferedReader reader = new BufferedReader(inputStreamReader);
+ new Thread(new Runnable() {
+ @Override
+ public void run() {
+ String line;
+ try {
+ while((line = reader.readLine()) != null) {
+ prompter.sendMessage(line);
+ }
+ } catch (Exception e) {
+ Log.w("end read unlimited!", e);
+ }
+ }
+ }).start();
+ }
+
@Override
protected Void doInBackground(Void... voids) {
TyshellClient client = new TyshellClient(hostname, port, new AndroidLogging());
client.connect(username, keyFile, new AsyncInteractiveLogin());
+ readUnlimited(client.getInputStream());
while (disconnect) {
String msg = null;
synchronized (messages) {