|
|
@@ -180,8 +180,14 @@ public class WebSocketProcess implements ApplicationContextAware {
|
|
|
* 发送消息到指定客户端
|
|
|
*/
|
|
|
public void sendMessage(String id, String message) throws Exception {
|
|
|
+ log.info("-------------sendMessage----------------");
|
|
|
+ log.info("-------------sendMessage {} {}----------------", id, message);
|
|
|
//根据id,从map中获取存储的webSocket对象
|
|
|
WebSocketProcess webSocketProcess = concurrentHashMap.get(id);
|
|
|
+ log.info("-------------webSocketProcess----------------");
|
|
|
+ System.out.println(concurrentHashMap);
|
|
|
+ log.info("-------------concurrentHashMap----------------");
|
|
|
+ System.out.println(webSocketProcess);
|
|
|
if (!ObjectUtils.isEmpty(webSocketProcess)) {
|
|
|
//当客户端是Open状态时,才能发送消息
|
|
|
if (webSocketProcess.session.isOpen()) {
|