mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 06:39:54 +01:00
Ensure we only call openOutputStream() once.
This commit is contained in:
@@ -18,6 +18,7 @@ class JavaBluetoothTransportConnection
|
|||||||
private final BluetoothConnectionLimiter connectionLimiter;
|
private final BluetoothConnectionLimiter connectionLimiter;
|
||||||
private final StreamConnection socket;
|
private final StreamConnection socket;
|
||||||
private final InputStream in;
|
private final InputStream in;
|
||||||
|
private final OutputStream out;
|
||||||
|
|
||||||
JavaBluetoothTransportConnection(Plugin plugin,
|
JavaBluetoothTransportConnection(Plugin plugin,
|
||||||
BluetoothConnectionLimiter connectionLimiter,
|
BluetoothConnectionLimiter connectionLimiter,
|
||||||
@@ -28,6 +29,7 @@ class JavaBluetoothTransportConnection
|
|||||||
this.socket = socket;
|
this.socket = socket;
|
||||||
in = timeoutMonitor.createTimeoutInputStream(
|
in = timeoutMonitor.createTimeoutInputStream(
|
||||||
socket.openInputStream(), plugin.getMaxIdleTime() * 2);
|
socket.openInputStream(), plugin.getMaxIdleTime() * 2);
|
||||||
|
out = socket.openOutputStream();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -36,8 +38,8 @@ class JavaBluetoothTransportConnection
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected OutputStream getOutputStream() throws IOException {
|
protected OutputStream getOutputStream() {
|
||||||
return socket.openOutputStream();
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user