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