为你的 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> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- 在XP上使用Multicast的C#SocketException
- winapi – Windows 8 SDK中的DirectX
- windows server 2008 AD与DNS服务器配置时注意的问题
- 如何在同一域中的不同服务器上设置Windows服务之间的依赖关
- 关闭Windows Defender保护
- windows-phone-7 – 操作方法:根据手机语言设置更改应用程
- windows-server-2008 – 是否有提供PowerShell输出的AD工具
- .net – Dll是已发布的网站,但在Build中缺失
- 在Windows上运行vim会留下不可写的交换文件
- 是否有用于Windows(或Linux)的iPhone模拟器来安装iPhone应用