Check that server sockets are closed as expected.

This commit is contained in:
akwizgran
2020-01-15 17:40:20 +00:00
parent 53889436fc
commit 6b33c5b913
4 changed files with 1 additions and 7 deletions

View File

@@ -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();

View File

@@ -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;

View File

@@ -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());

View File

@@ -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;