1、不在整点发
This commit is contained in:
parent
1e9e4b8680
commit
cc5f3d0772
@ -119,7 +119,7 @@ public class TCPClient {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.toString());
|
logger.error(e.toString());
|
||||||
}
|
}
|
||||||
},isIdle?60:10, TimeUnit.SECONDS);
|
},isIdle?30:10, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import com.imdroid.common.util.GsonUtil;
|
|||||||
import com.imdroid.common.util.NumberUtils;
|
import com.imdroid.common.util.NumberUtils;
|
||||||
import com.imdroid.secapi.dto.GnssCalcData;
|
import com.imdroid.secapi.dto.GnssCalcData;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -15,7 +14,7 @@ import java.util.List;
|
|||||||
public class GXXfzForwarder extends Forwarder{
|
public class GXXfzForwarder extends Forwarder{
|
||||||
TCPClient xfzTcpClient;
|
TCPClient xfzTcpClient;
|
||||||
|
|
||||||
static class XFZTCPListener implements TCPListener{
|
class XFZTCPListener implements TCPListener{
|
||||||
public static final int STATE_NO_ACK = 0;
|
public static final int STATE_NO_ACK = 0;
|
||||||
public static final int STATE_OK = 1;
|
public static final int STATE_OK = 1;
|
||||||
public static final int STATE_FAILED = 2;
|
public static final int STATE_FAILED = 2;
|
||||||
@ -36,6 +35,7 @@ public class GXXfzForwarder extends Forwarder{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessage(String msg) {
|
public void onMessage(String msg) {
|
||||||
|
logger.info("{} client rx: {}",fwdGroupId, msg);
|
||||||
if(msg.contains("succeed")) state = STATE_OK;
|
if(msg.contains("succeed")) state = STATE_OK;
|
||||||
else state = STATE_FAILED;
|
else state = STATE_FAILED;
|
||||||
}
|
}
|
||||||
@ -108,8 +108,8 @@ public class GXXfzForwarder extends Forwarder{
|
|||||||
|
|
||||||
boolean checkResult() throws InterruptedException {
|
boolean checkResult() throws InterruptedException {
|
||||||
// 等待应答,最多等1s
|
// 等待应答,最多等1s
|
||||||
for(int i=0; i<10; i++){
|
for(int i=0; i<20; i++){
|
||||||
Thread.sleep(100);
|
Thread.sleep(50);
|
||||||
if(listener.state == XFZTCPListener.STATE_OK) return true;
|
if(listener.state == XFZTCPListener.STATE_OK) return true;
|
||||||
else if(listener.state == XFZTCPListener.STATE_FAILED) return false;
|
else if(listener.state == XFZTCPListener.STATE_FAILED) return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user