From 12474e42179051720a23d7c921fd33ce50e9ffab Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期五, 18 二月 2022 16:16:00 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/BarcodeThread.java | 23 ++++++++++++-----------
src/main/resources/application.yml | 2 +-
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/BarcodeThread.java b/src/main/java/com/zy/core/thread/BarcodeThread.java
index b34d7d4..b8710a6 100644
--- a/src/main/java/com/zy/core/thread/BarcodeThread.java
+++ b/src/main/java/com/zy/core/thread/BarcodeThread.java
@@ -43,6 +43,7 @@
String s = new String(read);
if (!Cools.isEmpty(s)) {
barcode = new String(read);
+ log.info("{}鍙锋潯鐮佸櫒锛屾绱㈡暟鎹細{}", slave.getId(), this.barcode);
}
}
Thread.sleep(100);
@@ -76,18 +77,18 @@
public void close() {
try {
if (null != dataOutputStream) {
- dataOutputStream.close();
- }
- if (null != dataInputStream) {
- dataInputStream.close();
- }
+ dataOutputStream.close();
+ }
+ if (null != dataInputStream) {
+ dataInputStream.close();
+ }
// if (null != socket && !socket.isClosed()) {
// socket.close();
// }
- if (null != socket){
- socket.close();
- }
- socket = null;
+ if (null != socket){
+ socket.close();
+ }
+ socket = null;
} catch (IOException e) {
log.error("SocketClient close Exception:" + e.getMessage());
}
@@ -111,8 +112,8 @@
int len = dataInputStream.read(bytes);
byte[] tempBytes = null;
if (len > 0) {
- tempBytes = new byte[len];
- System.arraycopy(bytes, 0, tempBytes, 0, len);
+ tempBytes = new byte[len];
+ System.arraycopy(bytes, 0, tempBytes, 0, len);
}
return tempBytes;
}
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index c18cd83..062f812 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -183,7 +183,7 @@
# 鏉$爜鎵弿浠�
barcode[0]:
id: 1
- ip: 192.168.10.130
+ ip: 10.10.10.52
port: 51236
# LED1
led[0]:
--
Gitblit v1.9.1