private boolean checkOpen(boolean recordException) {
        if (!isOpen()) {
            if (recordException) {
                recordException(new ClosedChannelException());
            }
            return false;
        }

        return true;
    }
Returns {@code true} if the {@link Channel} is open and records optionally
an {@link Exception} if it isn't.
plc4j/transports/test/src/main/java/io/netty/channel/embedded/Plc4xEmbeddedChannel.java