added
public boolean isClosed() {
return isClosed.get();
}
@@ -26,6 +26,7 @@ import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Function;
/**
@@ -41,6 +42,7 @@ public class HeaderTcpHandler<T extends NetworkContext> implements TcpHandler {
private final Function<Object, TcpHandler> handlerFunction;
@NotNull
private final NetworkContext nc;
+ private AtomicBoolean isClosed = new AtomicBoolean();
public HeaderTcpHandler(@NotNull final TcpEventHandler handlerManager,
@NotNull final Function<Object, TcpHandler> handlerFunction,
@@ -102,4 +104,14 @@ public class HeaderTcpHandler<T extends NetworkContext> implements TcpHandler {
sd.readMarshallable(inWire);
return sd;
}
+
+ @Override
+ public boolean isClosed() {
+ return isClosed.get();
+ }
+
+ @Override
+ public void close() {
+ isClosed.set(true);
+ }
}
