|
@@ -3,6 +3,9 @@ package com.persagy.ibms.data.sdk.service.websocket.server;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
+
|
|
|
import io.netty.channel.Channel;
|
|
|
import io.netty.channel.group.ChannelGroup;
|
|
|
import io.netty.channel.group.DefaultChannelGroup;
|
|
@@ -21,7 +24,7 @@ public class WebSocketChannelPool {
|
|
|
try {
|
|
|
Channel channel = id2Channel.get(id);
|
|
|
if (channel != null) {
|
|
|
- String sendString = content.toString();
|
|
|
+ String sendString = JSONObject.toJSONString(content, SerializerFeature.WriteMapNullValue);
|
|
|
channel.writeAndFlush(new TextWebSocketFrame(sendString));
|
|
|
}
|
|
|
} catch (Exception e) {
|