Code example for BluetoothSocket

Methods: close, connect

0
		} 
 
		@Override 
		public void run() { 
			try { 
				socket.connect();
				connected(socket, device);
			} catch (IOException e1) {
				connectionFailed(); 
				try { 
					socket.close();
				} catch (IOException e2) {
					Log.e(TAG, "Unable to close socket after connection failure", e2);
				} 
			} 
		} 
 
		private void cancel() { 
			try { 
				socket.close();
			} catch (IOException e) {