Pu Zhibing
3 天以前 607a2413533f10be28ebbfe1c96a4669a3150ce4
MessagePushTravel/src/main/java/com/sinata/push/util/applets/NettyWebSocketController.java
@@ -13,19 +13,24 @@
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Timer;
import java.util.TimerTask;
@Component
public class NettyWebSocketController {
    public static Hashtable<String, Hashtable<ChannelHandlerContext, String>> map = new Hashtable<String, Hashtable<ChannelHandlerContext,String>>();
    private RedisTemplate<String, String> redisTemplate = SpringUtil.getObject(StringRedisTemplate.class);
    @Resource
    private RedisTemplate<String, Object> redisTemplate;
   public static Hashtable<String,String> table;
   static{
@@ -112,7 +117,7 @@
        }
    } catch (Exception e) {
        if(isdebug) {
           NettyWebSocketController.sendMsgToClient(ctx, "__error__" + msg.toString());
           this.sendMsgToClient(ctx, "__error__" + msg.toString());
        }
        e.printStackTrace();
    }