public void setBusy(long termId) {
        if (this.channelTermId.get() != termId
                || this.conStatus.get() != CLIENT_STATUS_READY) {
            return;
        }
        boolean changed = false;
        long befTime;
        int curTimeoutCnt;
        long curTime = System.currentTimeMillis();
        rw.readLock().lock();
        try {
            if (this.channelTermId.get() != termId) {
                return;
            }
            befTime = this.chanFstBusyTime.get();
            if (curTime - befTime >= tcpConfig.getSyncMsgTimeoutChkDurMs()) {
                if (this.chanFstBusyTime.compareAndSet(befTime, curTime)) {
                    this.chanSyncTimeoutCnt.set(0);
                }
            }
            curTimeoutCnt = this.chanSyncTimeoutCnt.incrementAndGet();
            if (tcpConfig.getMaxAllowedSyncMsgTimeoutCnt() >= 0
                    && curTimeoutCnt < tcpConfig.getMaxAllowedSyncMsgTimeoutCnt()) {
                return;
            }
            int curStatus = this.conStatus.get();
            if (curStatus == CLIENT_STATUS_READY) {
                this.conStatus.compareAndSet(curStatus, CLIENT_STATUS_BUSY);
                this.chanInvalidTime.set(System.currentTimeMillis());
                changed = true;
            }
        } finally {
            rw.readLock().unlock();
        }
        if (changed) {
            logger.warn("NettyClient({}) set {} busy!", senderId, hostInfo.getReferenceName());
        }
    }
TCP Netty client class

Used to manage TCP netty client, including connection, closing, keep-alive, sending status check, etc.
inlong-sdk/dataproxy-sdk/src/main/java/org/apache/inlong/sdk/dataproxy/network/tcp/TcpNettyClient.java