#
luxiaotao1123
2022-02-18 12474e42179051720a23d7c921fd33ce50e9ffab
#
2个文件已修改
25 ■■■■ 已修改文件
src/main/java/com/zy/core/thread/BarcodeThread.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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;
    }
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]: