zoukankan      html  css  js  c++  java
  • 为你的 SuperSocket 启用动态语言

    步骤如下:

    1.添加 DLR (dynamic language runtime) 配置片段;

    Section 定义:

    <section name="microsoft.scripting" requirePermission="false"

         type="Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting"/>

    Section 内容:

    <microsoft.scripting>

        <languages>

            <language extensions=".py" displayName="IronPython"

                type="IronPython.Runtime.PythonContext, IronPython"

                names="IronPython;Python;py"/>

        </languages>

    </microsoft.scripting>

    2.增加 DLR 命令加载器;

    <SuperSocket>

        ......

        <commandLoaders>

            <add name="dynamicCommandLoader" type="SuperSocket.Dlr.DynamicCommandLoader, SuperSocket.Dlr"/>

        </commandLoaders>

    </superSocket>

    3.为你的服务器实例启用该命令加载器:

    <servers>

      <server name="IronPythonServer"

          serverTypeName="IronPythonService"

          ip="Any" port="2012"

          maxConnectionNumber="50"

          commandLoader="dynamicCommandLoader">

      </server>

    </servers>

    完整的配置如下:

    <?xml version="1.0"?>

    <configuration>

      <configSections>

        <section name="superSocket" type="SuperSocket.SocketEngine.Configuration.SocketServiceConfig, SuperSocket.SocketEngine" />

        <section name="microsoft.scripting" requirePermission="false"

                 type="Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting"/>

      </configSections>

      <appSettings>

        <add key="ServiceName" value="SupperSocketService" />

      </appSettings>

      <connectionStrings/>

      <superSocket>

        <servers>

          <server name="IronPythonServer"

              serverTypeName="IronPythonService"

              ip="Any" port="2012"

              maxConnectionNumber="50"

              commandLoader="dynamicCommandLoader">

          </server>

        </servers>

        <serverTypes>

          <add name="IronPythonService"

           type="SuperSocket.QuickStart.IronSocketServer.DynamicAppServer, SuperSocket.QuickStart.IronSocketServer" />

        </serverTypes>

        <commandLoaders>

            <add name="dynamicCommandLoader" type="SuperSocket.Dlr.DynamicCommandLoader, SuperSocket.Dlr"/>

        </commandLoaders>

      </superSocket>

      <microsoft.scripting>

        <languages>

          <language extensions=".py" displayName="IronPython"

                type="IronPython.Runtime.PythonContext, IronPython"

                names="IronPython;Python;py"/>

        </languages>

      </microsoft.scripting>

      <startup>

        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />

      </startup>

    </configuration>

  • 相关阅读:
    【hdu 2222】Keywords Search
    【codeforces 750E】New Year and Old Subsequence
    Bit error testing and training in double data rate (ddr) memory system
    北风网09.接收普通消息2
    北风网08.接收普通消息1
    慕课网消息的接收与响应2
    MyEclipse/eclipse 添加作者、注释、版本、时间等
    北风网开发者接入
    java.lang.Error: Unresolved compilation problem: 解决方案
    北风网环境搭建二
  • 原文地址:https://www.cnblogs.com/fanweisheng/p/11127002.html
Copyright © 2011-2022 走看看