diff --git a/ice-adapter/src/main/java/com/faforever/iceadapter/IceAdapter.java b/ice-adapter/src/main/java/com/faforever/iceadapter/IceAdapter.java index 1dd49ef..d5ca260 100644 --- a/ice-adapter/src/main/java/com/faforever/iceadapter/IceAdapter.java +++ b/ice-adapter/src/main/java/com/faforever/iceadapter/IceAdapter.java @@ -31,7 +31,6 @@ public class IceAdapter implements Callable, AutoCloseable { @CommandLine.ArgGroup(exclusive = false) private IceOptions iceOptions; - private volatile boolean running = true; private final ExecutorService executor = ExecutorHolder.getExecutor(); private static final Lock lockGameSession = new ReentrantLock(); @@ -195,10 +194,6 @@ public static double getAcceptableLatency() { return INSTANCE.iceOptions.getAcceptableLatency(); } - public static boolean isRunning() { - return INSTANCE.running; - } - public static Executor getExecutor() { return INSTANCE.executor; } diff --git a/ice-adapter/src/main/java/com/faforever/iceadapter/gpgnet/GPGNetServer.java b/ice-adapter/src/main/java/com/faforever/iceadapter/gpgnet/GPGNetServer.java index 456b586..32eb9e1 100644 --- a/ice-adapter/src/main/java/com/faforever/iceadapter/gpgnet/GPGNetServer.java +++ b/ice-adapter/src/main/java/com/faforever/iceadapter/gpgnet/GPGNetServer.java @@ -221,7 +221,7 @@ private static void onGpgnetConnectionLost() { * Listens for incoming connections from a game instance */ private static void acceptThread() { - while (!Thread.currentThread().isInterrupted() && IceAdapter.isRunning()) { + while (!Thread.currentThread().isInterrupted()) { try { Socket socket = serverSocket.accept(); LockUtil.executeWithLock(lockSocket, () -> { diff --git a/ice-adapter/src/main/java/com/faforever/iceadapter/ice/Peer.java b/ice-adapter/src/main/java/com/faforever/iceadapter/ice/Peer.java index efe91cc..0d1e575 100644 --- a/ice-adapter/src/main/java/com/faforever/iceadapter/ice/Peer.java +++ b/ice-adapter/src/main/java/com/faforever/iceadapter/ice/Peer.java @@ -102,10 +102,7 @@ void onIceDataReceived(byte[] data, int offset, int length) { private void faListener() { byte[] data = new byte [65536]; // 64KiB = UDP MTU, in practice due to ethernet frames being <= 1500 B, this is often not used - while (!Thread.currentThread().isInterrupted() - && IceAdapter.isRunning() - && IceAdapter.getGameSession() == gameSession - && !closing) { + while (!Thread.currentThread().isInterrupted() && IceAdapter.getGameSession() == gameSession && !closing) { try { DatagramPacket packet = new DatagramPacket(data, data.length); faSocket.receive(packet); diff --git a/ice-adapter/src/main/java/com/faforever/iceadapter/ice/PeerIceModule.java b/ice-adapter/src/main/java/com/faforever/iceadapter/ice/PeerIceModule.java index 6cb62bf..6cb1f72 100644 --- a/ice-adapter/src/main/java/com/faforever/iceadapter/ice/PeerIceModule.java +++ b/ice-adapter/src/main/java/com/faforever/iceadapter/ice/PeerIceModule.java @@ -500,9 +500,7 @@ public void listener() { byte[] data = new byte [65536]; // 64KiB = UDP MTU, in practice due to ethernet frames being <= 1500 B, this is often not used - while (!Thread.currentThread().isInterrupted() - && IceAdapter.isRunning() - && IceAdapter.getGameSession() == peer.getGameSession()) { + while (!Thread.currentThread().isInterrupted() && IceAdapter.getGameSession() == peer.getGameSession()) { try { DatagramPacket packet = new DatagramPacket(data, data.length); localComponent