@Override
    protected void doWrite(ChannelOutboundBuffer in) throws Exception {
        for (;;) {
            Object msg = in.current();
            if (msg == null) {
                break;
            }

            ReferenceCountUtil.retain(msg);
            handleOutboundMessage(msg);
            in.remove();
        }
    }
Ensure the {@link Channel} is open and if not throw an exception.
plc4j/transports/test/src/main/java/io/netty/channel/embedded/Plc4xEmbeddedChannel.java