1、增加log查问题
This commit is contained in:
parent
cc5f3d0772
commit
e286c355ff
@ -92,6 +92,7 @@ public class TCPClient {
|
||||
public void writeAndFlush(String json) {
|
||||
ByteBuf sendBuffer = Unpooled.buffer();
|
||||
sendBuffer.writeBytes(json.getBytes(StandardCharsets.UTF_8));
|
||||
logger.info("send to {}: {}",host,json);
|
||||
channel.writeAndFlush(sendBuffer).addListener(future -> {
|
||||
if (future.isSuccess()) {
|
||||
logger.info("send to tcp:"+host+" succeed.");
|
||||
|
||||
@ -73,8 +73,8 @@ public class GXXfzForwarder extends Forwarder{
|
||||
|
||||
if(batchNum==50){
|
||||
String json = "#" + GsonUtil.toJson(xfzTcpMessage) + "!";
|
||||
logger.debug("project {}: forwad {} gnss records to {}",projectId, dataList.size(),fwdGroupId);
|
||||
logger.debug(json);
|
||||
//logger.debug("project {}: forwad {} gnss records to {}",projectId, dataList.size(),fwdGroupId);
|
||||
//logger.debug(json);
|
||||
try {
|
||||
listener.clear();
|
||||
xfzTcpClient.writeAndFlush(json);
|
||||
@ -91,8 +91,8 @@ public class GXXfzForwarder extends Forwarder{
|
||||
|
||||
if(batchNum>0){
|
||||
String json = "#" + GsonUtil.toJson(xfzTcpMessage) + "!";
|
||||
logger.debug("project {}: forwad {} gnss records to {}",projectId, dataList.size(),fwdGroupId);
|
||||
logger.debug(json);
|
||||
//logger.debug("project {}: forwad {} gnss records to {}",projectId, dataList.size(),fwdGroupId);
|
||||
//logger.debug(json);
|
||||
try {
|
||||
listener.clear();
|
||||
xfzTcpClient.writeAndFlush(json);
|
||||
@ -107,8 +107,8 @@ public class GXXfzForwarder extends Forwarder{
|
||||
}
|
||||
|
||||
boolean checkResult() throws InterruptedException {
|
||||
// 等待应答,最多等1s
|
||||
for(int i=0; i<20; i++){
|
||||
// 等待应答,最多等500ms
|
||||
for(int i=0; i<10; i++){
|
||||
Thread.sleep(50);
|
||||
if(listener.state == XFZTCPListener.STATE_OK) return true;
|
||||
else if(listener.state == XFZTCPListener.STATE_FAILED) return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user