@Override
    protected int doWriteBytes(ByteBuf buf) throws Exception {
        // Here we really write bytes to Socket!
        if (!active) {
            return 0;
        }
        logger.debug("Trying to write bytes to wire...");
        int bytesWritten = comPort.write(buf);
        logger.debug("Wrote {} bytes to wire!", bytesWritten);
        return bytesWritten;
    }
Create a new instance

@param parent the parent {@link Channel} by which this instance was created. May be {@code null}
@param ch     the underlying {@link SelectableChannel} on which it operates
plc4j/transports/serial/src/main/java/org/apache/plc4x/java/transport/serial/SerialChannel.java