mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 12:49:55 +01:00
If the modem is off the hook when it's stopped, hang up.
This commit is contained in:
@@ -91,6 +91,8 @@ class ModemImpl implements Modem, WriteHandler, SerialPortEventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void stop() throws IOException {
|
public void stop() throws IOException {
|
||||||
|
if(offHook.tryAcquire()) offHook.release();
|
||||||
|
else hangUp();
|
||||||
try {
|
try {
|
||||||
port.closePort();
|
port.closePort();
|
||||||
} catch(SerialPortException e) {
|
} catch(SerialPortException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user