liurunyu
2024-11-08 04779efe2410fb0df1ff983b26384d56471b85cf
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/TcpClUnit.java
@@ -2,7 +2,7 @@
import com.dy.common.mw.UnitAdapterInterface;
import com.dy.common.mw.UnitInterface;
import com.dy.common.mw.UnitStartedCallbackInterface;
import com.dy.common.mw.UnitCallbackInterface;
import com.dy.common.threadPool.ThreadPool;
import com.dy.common.threadPool.TreadPoolFactory;
import com.dy.common.util.Callback;
@@ -53,7 +53,7 @@
    }
    @Override
    public void start(UnitStartedCallbackInterface callback) throws Exception {
    public void start(UnitCallbackInterface callback) throws Exception {
        pool = TreadPoolFactory.getThreadPoolLong() ;
        System.out.println("Tcp Client模块成功启动");
        this.doStart();
@@ -61,7 +61,7 @@
    }
    @Override
    public void stop(UnitStartedCallbackInterface callback) throws Exception {
    public void stop(UnitCallbackInterface callback) throws Exception {
        callback.call(null);
    }
@@ -71,7 +71,7 @@
            public void run() {
                try {
                    while(true){
                        if(!ServerProperties.startWork){
                        if(!ServerProperties.startTcpConnectWork){
                            Thread.sleep(100L);
                        }else{
                            try{
@@ -101,7 +101,14 @@
                                    }
                                }
                                startJob() ;
                                while (true){
                                    if(!ServerProperties.startRtuReportWork){
                                        Thread.sleep(100L);
                                    }else{
                                        startJob() ;
                                        break ;
                                    }
                                }
                                while(true){
                                    if(totalOverClientCount.longValue() >= totalRtuClientCount.longValue()){
@@ -210,16 +217,16 @@
        totalSendDataCount++;
        if(totalOverClientCount.longValue() >= totalRtuClientCount.longValue()){
            RmiClUnit.getInstance().reportHadReportCount(totalSendDataCount);
            System.out.println("已经发送" + totalSendDataCount + "条数据");
            System.out.println("已经发送" + totalSendDataCount + "条数据(心跳和上报)");
        }else{
            if(totalRtuClientCount > 100){
                if(totalSendDataCount % 100 == 0){
                    RmiClUnit.getInstance().reportHadReportCount(totalSendDataCount);
                    System.out.println("已经发送" + totalSendDataCount + "条数据");
                    System.out.println("已经发送" + totalSendDataCount + "条数据(心跳和上报)");
                }
            }else{
                RmiClUnit.getInstance().reportHadReportCount(totalSendDataCount);
                System.out.println("已经发送" + totalSendDataCount + "条数据");
                System.out.println("已经发送" + totalSendDataCount + "条数据(心跳和上报)");
            }
        }
    }