comparison src/com/five_ten_sg/connectbot/service/TerminalMonitor.java @ 400:e856ecf87b10

Backed out changeset aeb8c2e6d83a
author Carl Byington <carl@five-ten-sg.com>
date Mon, 20 Oct 2014 19:12:52 -0700
parents aeb8c2e6d83a
children 977815f990ec
comparison
equal deleted inserted replaced
399:aeb8c2e6d83a 400:e856ecf87b10
93 //Log.i(TAG, String.format("sending %d command", (int)c[1])); 93 //Log.i(TAG, String.format("sending %d command", (int)c[1]));
94 monitor_out.write(charsToBytes(c)); 94 monitor_out.write(charsToBytes(c));
95 } 95 }
96 } 96 }
97 catch (InterruptedException e) { 97 catch (InterruptedException e) {
98 if (!is_closing) Log.e(TAG, "exception in MyWriter.run()", e); 98 if (!is_closing) Log.e(TAG, "exception in monitorWrite()", e);
99 } 99 }
100 catch (IOException e) { 100 catch (IOException e) {
101 Log.i(TAG, "exception in MyWriter.run(), monitor died or closed the socket", e); 101 Log.i(TAG, "exception in monitorWrite(), monitor died or closed the socket", e);
102 } 102 }
103 103
104 try { 104 try {
105 monitor_out.close(); 105 monitor_out.close();
106 } 106 }
107 catch (IOException e) { 107 catch (IOException ee) {
108 Log.e(TAG, "exception in MyWriter.run() closing output stream", e); 108 Log.e(TAG, "exception in monitorWrite() closing output stream", ee);
109 } 109 }
110 monitor_out = null; 110 monitor_out = null;
111 } 111 }
112 } 112 }
113 113
346 return b; 346 return b;
347 } 347 }
348 348
349 349
350 public void monitorWrite(char cmd, char[] c) { 350 public void monitorWrite(char cmd, char[] c) {
351 try { 351 c[0] = (char)(c.length - 1); // number of chars following
352 c[0] = (char)(c.length - 1); // number of chars following 352 c[1] = cmd;
353 c[1] = cmd; 353 pending_commands.put(c);
354 pending_commands.put(c);
355 }
356 catch (InterruptedException e) {
357 Log.e(TAG, "exception in monitorWrite()", e);
358 }
359 }; 354 };
360 355
361 public void resetWatch() { 356 public void resetWatch() {
362 start_line = 0; 357 start_line = 0;
363 end_line = 500; 358 end_line = 500;