|
|
@ -79,8 +79,12 @@ public class TCPClient { |
|
|
log.error("连接设备失败,IP:{},Port:{}",config.getIp(),config.getPort(),e); |
|
|
log.error("连接设备失败,IP:{},Port:{}",config.getIp(),config.getPort(),e); |
|
|
}finally { |
|
|
}finally { |
|
|
try { |
|
|
try { |
|
|
Objects.requireNonNull(in).close(); |
|
|
|
|
|
Objects.requireNonNull(socket).close(); |
|
|
|
|
|
|
|
|
if (in!= null){ |
|
|
|
|
|
in.close(); |
|
|
|
|
|
} |
|
|
|
|
|
if (socket!= null && !socket.isClosed()){ |
|
|
|
|
|
socket.close(); |
|
|
|
|
|
} |
|
|
} catch (IOException e) { |
|
|
} catch (IOException e) { |
|
|
log.error("关闭输入流失败", e); |
|
|
log.error("关闭输入流失败", e); |
|
|
} |
|
|
} |
|
|
|