|
|
@@ -33,6 +33,7 @@ public class DeJuRFIDListenerService implements IService {
|
|
|
log.info("开始监听");
|
|
|
} else {
|
|
|
log.info("监听失败");
|
|
|
+ start(hardware);
|
|
|
throw new ServiceException("监听失败");
|
|
|
}
|
|
|
}
|
|
|
@@ -53,7 +54,7 @@ public class DeJuRFIDListenerService implements IService {
|
|
|
log.info(client.getName() + "---监听成功");
|
|
|
client.setSendHeartBeat(true);//开启心跳检测Tcp连接状态
|
|
|
client.setPrint(true);
|
|
|
- subscribeTcpHandler(client);//订阅Tcp断连上报
|
|
|
+ subscribeTcpHandler(client,hardware);//订阅Tcp断连上报
|
|
|
DeJuRFIDService.setPower(hardware, client);
|
|
|
DeJuRFIDService.setInventory(hardware, client);
|
|
|
DeJuRFIDService.subscribeHandler(client);
|
|
|
@@ -61,10 +62,11 @@ public class DeJuRFIDListenerService implements IService {
|
|
|
}
|
|
|
|
|
|
//订阅TCP断开连接上报
|
|
|
- private void subscribeTcpHandler(GClient client) {
|
|
|
+ private void subscribeTcpHandler(GClient client, RemoteLabHardware hardware) {
|
|
|
client.onDisconnected = s -> {
|
|
|
log.info("连接" + s + "已断开");
|
|
|
client.close();//释放当前连接资源
|
|
|
+ start(hardware);
|
|
|
};
|
|
|
}
|
|
|
|