From fc08466bbe495a363ac840f93511d970715c504e Mon Sep 17 00:00:00 2001
From: whycq <whycq>
Date: 星期一, 21 二月 2022 13:17:23 +0800
Subject: [PATCH] #css 修改176
---
src/main/java/com/zy/core/thread/BarcodeThread.java | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 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;
}
--
Gitblit v1.9.1