@Override
        public void operationComplete(ChannelFuture f) throws Exception {
            if (!f.isSuccess()) {
                future.completeExceptionally(f.cause());
                return;
            }
            if (!it.hasNext()) {
                future.complete(null);
                return;
            }

            final ServerPort next = it.next();
            final ServerPort actualNext;

            // Try to use the same port number if the port belongs to a group.
            // See: https://github.com/line/armeria/issues/3725
            final long portGroup = next.portGroup();
            if (portGroup != 0) {
                int previousPort = 0;
                lock.lock();
                try {
                    for (ServerPort activePort : activePorts.values()) {
                        if (activePort.portGroup() == portGroup) {
                            previousPort = activePort.localAddress().getPort();
                            break;
                        }
                    }
                } finally {
                    lock.unlock();
                }

                if (previousPort > 0) {
                    // Use the previously bound ephemeral local port.
                    actualNext = new ServerPort(
                            new InetSocketAddress(next.localAddress().getAddress(), previousPort),
                            next.protocols(), portGroup);
                } else {
                    // `next` is the first ephemeral local port.
                    actualNext = next;
                }
            } else {
                actualNext = next;
            }

            startStopSupport.doStart(actualNext)
                            .addListener(new ServerPortStartListener(actualNext))
                            .addListener(this);
        }
Initiates the next bind operation if the previous bind attempt was successful.
core/src/main/java/com/linecorp/armeria/server/Server.java