Repository: netty/netty
File: transport-classes-io_uring/src/main/java/io/netty/channel/uring/AbstractIoUringServerChannel.java (Java)

Code before:
            Buffer.free(acceptedAddressMemory);
            Buffer.free(acceptedAddressLengthMemory);
        }
    }
    private final AcceptedAddressMemory acceptedAddressMemory;
    private long acceptId;

    protected AbstractIoUringServerChannel(LinuxSocket socket, boolean active) {
        super(null, socket, active);

        // We can only depend on the accepted address if multi-shot is not used.
        // From the manpage:
        //       The multishot variants allow an application to issue a single
        //       accept request, which will repeatedly trigger a CQE when a
        //       connection request comes in. Like other multishot type requests,
        //       the application should look at the CQE flags and see if
        //       IORING_CQE_F_MORE is set on completion as an indication of whether
        //       or not the accept request will generate further CQEs. Note that
        //       for the multishot variants, setting addr and addrlen may not make
        //       a lot of sense, as the same value would be used for every accepted
        //       connection. This means that the data written to addr may be
        //       overwritten by a new connection before the application has had
        //       time to process a past connection. If the application knows that a
        //       new connection cannot come in before a previous one has been
        //       processed, it may be used as expected.
        if (IoUring.isIOUringAcceptNoWaitSupported()) {
            acceptedAddressMemory = null;
        } else {
            acceptedAddressMemory = new AcceptedAddressMemory();
        }
    }

    @Override
    public final ChannelMetadata metadata() {
        return METADATA;
    }

    @Override
    protected final void doClose() throws Exception {
        super.doClose();
    }

    @Override
    protected final AbstractUringUnsafe newUnsafe() {
        return new UringServerChannelUnsafe();
    }

    @Override
    protected final void doWrite(ChannelOutboundBuffer in) {
        throw new UnsupportedOperationException();
    }

Review comment (suggestion):
why `isIOUringAcceptNoWaitSupported`. I think it should be `isIOUringAcceptMultishotSupported`

Code after:
            Buffer.free(acceptedAddressMemory);
            Buffer.free(acceptedAddressLengthMemory);
        }
    }
    private final AcceptedAddressMemory acceptedAddressMemory;
    private long acceptId;

    protected AbstractIoUringServerChannel(LinuxSocket socket, boolean active) {
        super(null, socket, active);

        // We can only depend on the accepted address if multi-shot is not used.
        // From the manpage:
        //       The multishot variants allow an application to issue a single
        //       accept request, which will repeatedly trigger a CQE when a
        //       connection request comes in. Like other multishot type requests,
        //       the application should look at the CQE flags and see if
        //       IORING_CQE_F_MORE is set on completion as an indication of whether
        //       or not the accept request will generate further CQEs. Note that
        //       for the multishot variants, setting addr and addrlen may not make
        //       a lot of sense, as the same value would be used for every accepted
        //       connection. This means that the data written to addr may be
        //       overwritten by a new connection before the application has had
        //       time to process a past connection. If the application knows that a
        //       new connection cannot come in before a previous one has been
        //       processed, it may be used as expected.
        if (IoUring.isIOUringAcceptMultishotSupported()) {
            acceptedAddressMemory = null;
        } else {
            acceptedAddressMemory = new AcceptedAddressMemory();
        }
    }

    @Override
    public final ChannelMetadata metadata() {
        return METADATA;
    }

    @Override
    protected final void doClose() throws Exception {
        super.doClose();
    }

    @Override
    protected final AbstractUringUnsafe newUnsafe() {
        return new UringServerChannelUnsafe();
    }

    @Override
    protected final void doWrite(ChannelOutboundBuffer in) {
        throw new UnsupportedOperationException();
    }