# HG changeset patch # User Carl Byington # Date 1571608047 25200 # Node ID d7461da8145b6ce4bfa3a307c64e88dd07f15b75 # Parent 186d340afd3b8be19f61c5828e3d3ae8085da30d only bind to the MonitorService for localhost monitor connections diff -r 186d340afd3b -r d7461da8145b app/src/main/java/com/five_ten_sg/connectbot/service/TerminalMonitor.java --- a/app/src/main/java/com/five_ten_sg/connectbot/service/TerminalMonitor.java Sun Oct 20 14:19:17 2019 -0700 +++ b/app/src/main/java/com/five_ten_sg/connectbot/service/TerminalMonitor.java Sun Oct 20 14:47:27 2019 -0700 @@ -189,7 +189,9 @@ public void onServiceConnected(ComponentName className, IBinder service) { bound = service; Log.i(TAG, "bound to service"); - + DoConnect(); + } + public void DoConnect() { try { InetAddress serverAddr = InetAddress.getByName(target); int tries = 0; @@ -284,10 +286,16 @@ keymap.put(0x85, vt320.KEY_F22); // vk_f22 keymap.put(0x86, vt320.KEY_F23); // vk_f23 keymap.put(0x87, vt320.KEY_F24); // vk_f24 - // bind to the monitor service - Intent intent = new Intent("com.five_ten_sg.connectbot.monitor.MonitorService"); - intent.setPackage("com.five_ten_sg.connectbot.monitor"); - parent.bindService(intent, monitor_connection, Context.BIND_AUTO_CREATE); + if (target == "localhost") { + // bind to the monitor service for localhost connections + Intent intent = new Intent("com.five_ten_sg.connectbot.monitor.MonitorService"); + intent.setPackage("com.five_ten_sg.connectbot.monitor"); + parent.bindService(intent, monitor_connection, Context.BIND_AUTO_CREATE); + } + else { + // direct socket connection to external device + monitor_connection.DoConnect(); + } Log.i(TAG, "constructor"); }