changeset 411:8bff0bfaec3a

wait for monitor socket to be created
author Carl Byington <carl@five-ten-sg.com>
date Fri, 24 Oct 2014 17:48:43 -0700
parents e2a56e383bad
children 057854c77217
files src/com/five_ten_sg/connectbot/service/TerminalMonitor.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/service/TerminalMonitor.java	Fri Oct 24 17:41:43 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/service/TerminalMonitor.java	Fri Oct 24 17:48:43 2014 -0700
@@ -175,14 +175,14 @@
             try {
                 InetAddress serverAddr = InetAddress.getByName(LOCALHOST);
                 int tries = 0;
-                while (tries < 5) {
+                while (tries < 10) {
                     try {
+                        Thread.sleep(100);
                         monitor_socket = new Socket(serverAddr, MONITORPORT);
                     }
                     catch (IOException e) {
                         Log.e(TAG, "exception connecting to monitor socket", e);
                         tries = tries + 1;
-                        Thread.sleep(1000);
                     }
                 }
                 Log.i(TAG, "connected to monitor socket, send init " + init);