类 SessionGroups

    • 构造器详细资料

    • 方法详细资料

      • bind

        public Sessions bind​(io.netty.channel.Channel ch,
                             String key)
        将用户连接绑定到群组
        参数:
        ch - 通道
        key - 组键值
      • unbind

        public void unbind​(io.netty.channel.Channel ch,
                           String key)
        解绑群组连接
        参数:
        ch -
        key -
      • exit

        public Sessions exit​(String userId,
                             String key)
        用户退出群组
        参数:
        userId -
        返回:
      • get

        public Sessions get​(String key)
        获取群组Sessions
        参数:
        key -
        返回:
      • alls

        public void alls​(Transportable msg)
        向所有连接发送消息【集群】
        参数:
        msg - 发送消息
      • all

        public io.netty.channel.group.ChannelGroupFuture all​(Transportable msg)
        向所有连接发送消息【非集群】
        参数:
        msg - 发送消息
        返回:
      • sends

        public void sends​(String groupKey,
                          Transportable msg)
        向集群指定群组推送通知
        参数:
        groupKey -
        msg -