zoukankan      html  css  js  c++  java
  • supersockets支持热更新的服务器实例配置选项

    SuperSocket 支持以下配置选项的热更新:

    * logCommand

    * idleSessionTimeOut

    * maxRequestLength

    * logBasicSessionActivity

    * logAllSocketException

    SuperSocket 支持所有自定义配置属性和自定义配置子节点的热更新。

    下面的代码将演示如何让你的自定义配置支持热更新:

    public class PushServer : AppServer

    {

        private int m_Interval;

        protected override bool Setup(IRootConfig rootConfig, IServerConfig config)

        {

            RegisterConfigHandler(config, "pushInterval", (value) =>

                {

                    // the code in this scope will be executed automatically

                    // after the configuration attribute "pushInterval" is changed

                    var interval = 0;

                    int.TryParse(value, out interval);

                    if (interval <= 0)

                        interval = 60;// 60 seconds by default

                    m_Interval = interval * 1000;

                    return true;

                });

            return true;

        }

        /// Other code

    }

    你可以在QuickStart中的 PushServer 项目中找到此更能的完整示例代码。

  • 相关阅读:
    Django 之DRF删改查的API接口
    Django 之DRF原理操作
    通过密码、username、时间戳进行md5加密简单脚本
    Java 之GC常用命令
    ORM 之常用查询、字段类型、约束
    ORM 之单表查询案例
    Django session使用
    K8S 之yaml文件参数介绍1
    K8S 之使用Capabilities与限制网络带宽
    K8S 之容器生命周期钩子
  • 原文地址:https://www.cnblogs.com/fanweisheng/p/11126925.html
Copyright © 2011-2022 走看看