mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 06:09:55 +01:00
Check that server sockets are closed as expected.
This commit is contained in:
@@ -147,7 +147,7 @@ class AndroidLanTcpPlugin extends LanTcpPlugin implements EventListener {
|
|||||||
} else if (addrs.isEmpty()) {
|
} else if (addrs.isEmpty()) {
|
||||||
LOG.info("Not connected to wifi");
|
LOG.info("Not connected to wifi");
|
||||||
socketFactory = SocketFactory.getDefault();
|
socketFactory = SocketFactory.getDefault();
|
||||||
// TODO: Check that socket was closed when interface went down
|
// Server socket was closed when wifi interface went down
|
||||||
} else {
|
} else {
|
||||||
LOG.info("Connected to wifi");
|
LOG.info("Connected to wifi");
|
||||||
socketFactory = getSocketFactory();
|
socketFactory = getSocketFactory();
|
||||||
|
|||||||
@@ -132,9 +132,6 @@ abstract class BluetoothPlugin<SS> implements DuplexPlugin, EventListener {
|
|||||||
|
|
||||||
void onAdapterDisabled() {
|
void onAdapterDisabled() {
|
||||||
LOG.info("Bluetooth disabled");
|
LOG.info("Bluetooth disabled");
|
||||||
// TODO: Is this needed, or will the socket be closed automatically?
|
|
||||||
SS ss = state.clearServerSocket();
|
|
||||||
tryToClose(ss);
|
|
||||||
connectionLimiter.allConnectionsClosed();
|
connectionLimiter.allConnectionsClosed();
|
||||||
callback.pluginStateChanged(getState());
|
callback.pluginStateChanged(getState());
|
||||||
}
|
}
|
||||||
@@ -237,7 +234,6 @@ abstract class BluetoothPlugin<SS> implements DuplexPlugin, EventListener {
|
|||||||
conn = acceptConnection(ss);
|
conn = acceptConnection(ss);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// This is expected when the socket is closed
|
// This is expected when the socket is closed
|
||||||
// TODO: Check that this is logged at shutdown/when BT disabled
|
|
||||||
LOG.info("Server socket closed");
|
LOG.info("Server socket closed");
|
||||||
state.clearServerSocket();
|
state.clearServerSocket();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -177,7 +177,6 @@ abstract class TcpPlugin implements DuplexPlugin {
|
|||||||
s.setSoTimeout(socketTimeout);
|
s.setSoTimeout(socketTimeout);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// This is expected when the server socket is closed
|
// This is expected when the server socket is closed
|
||||||
// TODO: Check that this is logged at shutdown/when LAN disabled
|
|
||||||
LOG.info("Server socket closed");
|
LOG.info("Server socket closed");
|
||||||
state.clearServerSocket(ss);
|
state.clearServerSocket(ss);
|
||||||
callback.pluginStateChanged(getState());
|
callback.pluginStateChanged(getState());
|
||||||
|
|||||||
@@ -463,7 +463,6 @@ abstract class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
|
|||||||
s.setSoTimeout(socketTimeout);
|
s.setSoTimeout(socketTimeout);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// This is expected when the server socket is closed
|
// This is expected when the server socket is closed
|
||||||
// TODO: Check that this is logged at shutdown
|
|
||||||
LOG.info("Server socket closed");
|
LOG.info("Server socket closed");
|
||||||
state.clearServerSocket(ss);
|
state.clearServerSocket(ss);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user