消息推送错误结束字符串

dev
anthonywj 2 years ago
parent 60887e6f46
commit 20d0da6075

@ -1,5 +1,6 @@
package com.glxp.sale.admin.socket.client; package com.glxp.sale.admin.socket.client;
import cn.hutool.core.thread.ThreadUtil;
import com.glxp.sale.admin.constant.SocketMsgType; import com.glxp.sale.admin.constant.SocketMsgType;
import com.glxp.sale.admin.service.param.SystemParamConfigService; import com.glxp.sale.admin.service.param.SystemParamConfigService;
import com.glxp.sale.admin.thread.HeartTaskService; import com.glxp.sale.admin.thread.HeartTaskService;
@ -29,6 +30,8 @@ public class WebSocketComponent implements CommandLineRunner {
@Override @Override
public void run(String... args) throws Exception { public void run(String... args) throws Exception {
ThreadUtil.execAsync(() -> {
String ip = systemParamConfigService.selectValueByParamKey("upper_server_ip"); String ip = systemParamConfigService.selectValueByParamKey("upper_server_ip");
ip = ip.replace("http://", ""); ip = ip.replace("http://", "");
try { try {
@ -58,6 +61,10 @@ public class WebSocketComponent implements CommandLineRunner {
e.printStackTrace(); e.printStackTrace();
} }
} }
);
}
public void initConnect(SpsWebSocketClient client) { public void initConnect(SpsWebSocketClient client) {
if (client == null && client.isOpen()) { if (client == null && client.isOpen()) {

@ -100,7 +100,7 @@ public class SpsSyncWebSocket {
// value.session.getBasicRemote().sendText(s); // value.session.getBasicRemote().sendText(s);
// } // }
// 推送结束符 // 推送结束符
value.session.getBasicRemote().sendText("#end#"); // value.session.getBasicRemote().sendText("#end#");
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
@ -128,7 +128,7 @@ public class SpsSyncWebSocket {
// value.session.getBasicRemote().sendText(s); // value.session.getBasicRemote().sendText(s);
// } // }
// 推送结束符 // 推送结束符
value.session.getBasicRemote().sendText("#end#"); // value.session.getBasicRemote().sendText("#end#");
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();

Loading…
Cancel
Save