fs-danaus
2021-04-26 f10e31da6d8c3e0925bf72828715afdf7d2fe769
src/com/yc/sdk/WebSocketMessage/entity/WsMessageUserEntity.java
@@ -2,6 +2,7 @@
import javax.websocket.Session;
import com.alibaba.fastjson.JSON;
import com.yc.action.grid.GridUtils;
import com.yc.im.action.WebSocketIMServer;
@@ -32,7 +33,23 @@
            message.setDbId(this.getDbId());
            info.setInfo(message);
            try {
                this.session.getBasicRemote().sendText(GridUtils.toJsonNotNull(info));//用异步发送
                this.session.getBasicRemote().sendText(JSON.toJSONString(info));//用异步发送
            } catch (Exception e) {
                e.printStackTrace();
                WebSocketIMServer.printError(e,this.session);
            }
        }
    }
    public void sendMessageV2(Object message){
        if (!this.session.isOpen()){
            return;
        }
        synchronized (this.session) {
            CallBackMessage info = new CallBackMessage();
            info.setInfo(message);
            try {
                this.session.getBasicRemote().sendText(JSON.toJSONString(info));//用异步发送
            } catch (Exception e) {
                e.printStackTrace();
                WebSocketIMServer.printError(e,this.session);