-
- public void close() {
- if (D) Log.i(TAG, "close(): begin");
- synchronized(this) {
- if (D) Log.i(TAG, "close(): synched");
-
- if (connect_thread != null) {
- if (D) Log.i(TAG, "close(): stopping connect_thread");
- connect_thread.cancel();
- connect_thread = null;
- }
- if (D) Log.i(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.i(TAG, "close(): stopping input_thread");
- try {
- if (D) Log.i(TAG, "close(): input_thread.interrupt().....");
- input_thread.interrupt();
- if (D) Log.i(TAG, "close(): input_thread.join().....");
- input_thread.join();
- } catch (Exception e) {}
- input_thread = null;
- }
- input = null;
- output = null;
- notifyAll();
- }
- }
-
-
- //public void flush_output() { super.flush_output(); }