|
|
|
|
@ -105,15 +105,19 @@ public class SickSocket {
|
|
|
|
|
try {
|
|
|
|
|
new Thread(future).start();
|
|
|
|
|
future.get(1000, TimeUnit.MILLISECONDS);
|
|
|
|
|
} catch (InterruptedException | ExecutionException | TimeoutException e) {
|
|
|
|
|
|
|
|
|
|
} catch (InterruptedException | ExecutionException e ) {
|
|
|
|
|
log.info("sick 读取的数据为:"+stringBuilder);
|
|
|
|
|
if("".equals(stringBuilder.toString())){
|
|
|
|
|
tcpLogger.error("sick 可以连接但发送返回存在问题,ip:{},info:{}", ip, e);
|
|
|
|
|
log.error("sick 可以连接但发送返回存在问题,ip:{},info:{}", ip, e);
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
}else {
|
|
|
|
|
return stringBuilder.toString();
|
|
|
|
|
}
|
|
|
|
|
}catch (TimeoutException e){
|
|
|
|
|
|
|
|
|
|
log.info("sick 读取的数据为:"+stringBuilder);
|
|
|
|
|
tcpLogger.error("sick 扫码超时,ip:{},info:{}", ip, e);
|
|
|
|
|
log.error("sick 扫码超时,ip:{},info:{}", ip, e);
|
|
|
|
|
}
|
|
|
|
|
return stringBuilder.toString();
|
|
|
|
|
}
|
|
|
|
|
|