+ if (D) Log.d(TAG, "close(): Closing socket");
+ try {
+ socket.close();
+ } catch (IOException e) {
+ if (D) Log.e(TAG, "close(): unable to close() socket");
+ }
+ if (input_thread != null) {
+ if (D) Log.d(TAG, "close(): stopping input_thread");
+ try {
+ if (D) Log.d(TAG, "close(): input_thread.interrupt().....");
+ input_thread.interrupt();
+ if (D) Log.d(TAG, "close(): input_thread.join().....");
+ input_thread.join();
+ } catch (Exception e) {}
+ input_thread = null;
+ }
+ input = null;
+ output = null;
+ notifyAll();