使用 Zeroc 中的 ICE,如何在 .NET 中配置 Icebox 来托管两个独立的服务?
使用 ICE 我可以使用以下命令启动单个服务器:(
iceboxnet.exe --Ice.Config=config.icebox
下载 ICE v3.4.1 演示源 并查看目录“Ice-3.4.1-demos\democs\IceGrid\simple”)
问题:我该如何做在同一个冰箱中启动两个服务器,每个服务器都包含在单独的 .dll 文件中?
Using ICE I can start a single server using the following command:
iceboxnet.exe --Ice.Config=config.icebox
(download the ICE v3.4.1 demo source and look at directory "Ice-3.4.1-demos\democs\IceGrid\simple")
Question: How do I start two servers within the same icebox, with each server contained in a separate .dll file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需重命名接口即可。请参阅 ZeroC 论坛以及如何在单个冰箱中运行两个服务?
Just rename the interface. See the ZeroC forums and How do I run two services in a single icebox?
密钥位于用户手册的“43.3.4:配置服务”下:
因此,您需要为每个服务使用不同的接口名称(这很有意义:每个服务需要一个唯一的名称)。我们需要复制接口“hello”,并将其命名为“hello2”。
在 config.icebox 中添加额外的一行:
创建 config.service 的副本,将其命名为 config2.service,并更改名称和端口:
... 编辑为:
现在,我们需要编译新版本的“helloservice”。 dll”,它使用“hello2”作为接口。遍历C#项目,将所有“hello”重命名为“hello2”,将编译输出从“helloservice.dll”重命名为“helloservice2.dll”。
现在,这两个服务将在同一个冰箱下启动,如果您通过更改 .config 文件来打开登录:
更新
呻吟。上面的所有代码并不是绝对必要的(除非您要创建两个服务)。我所需要做的就是重命名适当的接口,请参阅 ZeroC 论坛以及如何在单个icebox 中运行两个服务?
The key is in the user manual under: "43.3.4: Configuring a Service":
So - you need to have different interface names for each service (which makes a lot of sense: it needs a unique name for each service). We need to make a copy of interface "hello", and name it "hello2".
Add an extra line to config.icebox:
Create a copy of config.service, name it config2.service, and change the name and the port:
... edits to:
Now, we need to compile a new version of "helloservice.dll" which uses "hello2" as the interface. Go through the C# project, and rename all "hello" to "hello2", rename the output of the compile to "helloservice2.dll" from "helloservice.dll".
Now, both services will start up under the same icebox, and if you turn logging on by altering the .config file:
Update
Groan. All the code above is not strictly necessary (unless you're creating two services). All I needed to do was rename the appropriate interfaces, see the ZeroC forums and How do I run two services in a single icebox?