Use WeakIdentityHashMap for tracking closeables, Make SocketChannnels closeable, Make all tests in bytes check all resources are closed.
@@ -20,6 +20,7 @@ package net.openhft.chronicle.network.connection;
import net.openhft.chronicle.bytes.Bytes;
import net.openhft.chronicle.bytes.ConnectionDroppedException;
import net.openhft.chronicle.core.Jvm;
+import net.openhft.chronicle.core.io.AbstractCloseable;
import net.openhft.chronicle.core.io.IORuntimeException;
import net.openhft.chronicle.core.util.ThrowingSupplier;
import net.openhft.chronicle.core.util.Time;
@@ -39,9 +40,11 @@ import java.util.function.Function;
import static java.lang.ThreadLocal.withInitial;
import static net.openhft.chronicle.network.connection.CoreFields.reply;
-public abstract class AbstractStatelessClient<E extends ParameterizeWireKey> implements Closeable {
- private static final WriteValue NOOP = out -> {};
+public abstract class AbstractStatelessClient<E extends ParameterizeWireKey> extends AbstractCloseable implements Closeable {
+
+ private static final WriteValue NOOP = out -> {
+ };
private static final Logger LOG = LoggerFactory.getLogger(AbstractStatelessClient.class);
@NotNull
@@ -563,7 +566,7 @@ public abstract class AbstractStatelessClient<E extends ParameterizeWireKey> imp
}
@Override
- public void close() {
+ protected void performClose() {
hub.close();
}
