private class AcceptThread extends Thread {
private final BluetoothServerSocket mmServerSocket;
public AcceptThread() {
BluetoothServerSocket tmp = null;
try {
tmp = mBluetoothAdapter.listenUsingRfcommWithServiceRecord(NAME, MY_UUID);
} catch (IOException e) { }
mmServerSocket = tmp;
}
public void run() {
BluetoothSocket socket = null;
while (true) {
try {
socket = mmServerSocket.accept();
} catch (IOException e) {
break;
}
if (socket != null) {
manageConnectedSocket(socket);
mmServerSocket.close();
break;
}
}
}
서버로 연결하는 블루투스 예제입니다. 예제 활용중에
계속 manageConnectedSocket(socket);에서 에러가 발생합니다. 그래서 일딴 주석처리를 하고 진행해도
mmServerSocket.close();에서
try {
mmServerSocket.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
이렇게 수정하라고 에러가 뜹니다 이둘의 원인을 고칠수없어 질문합니다 ㅠㅠ 자세히좀 알려주세요