Commit 100b9d11 authored by Nicolas Gilmard's avatar Nicolas Gilmard

Correct bluetooth server closing

parent ce898f80
......@@ -72,9 +72,16 @@ public class BluetoothServer extends ServerAdapter {
*/
@Override
public void acceptClient() throws IOException {
client = server.acceptAndOpen();
inputStream = client.openInputStream();
outputStream = client.openOutputStream();
try {
client = server.acceptAndOpen();
inputStream = client.openInputStream();
outputStream = client.openOutputStream();
} catch (IOException e) {
if (server != null) {
server.close();
}
}
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment