如何将DataSnap客户端连接定向到各种DS Server? [英] How to direct DataSnap client connections to various DS Servers?

查看:161
本文介绍了如何将DataSnap客户端连接定向到各种DS Server?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个相当大的DataSnap服务器,它将全天候运行24/7,它将替代当前正在运行的MIDAS(COM)服务器。现在,我面临的问题是如何更新该服务器而不必强制断开所有已连接的客户端。

I have a quite big DataSnap server that will be running 24/7, it will substitute a currently running MIDAS (COM) server. Now I'm facing the problem of how to update that server without having to force disconnection of all connected clients.

使用当前的Midas服务器(顺便说一下, (没有大量的服务),我只是等到没有连接,然后关闭服务器应用程序并替换为exe文件。如果在服务器关闭(作为COM对象)时发生了新连接,则操作系统将拉起该连接,而不会给客户端带来任何问题。

With the current midas server (that, by the way, doesn't have a huge traffic to serve) I simply wait until there are no connections, then shut down the server application and substitute the exe file. If a new connection occurred while the server was "down", being it a COM object, it will be "pulled up" by the OS, giving no problems to the clients.

新的DataSnap架构不再基于COM(太棒了!),但是这样一来,我就失去了停止服务器而又不会导致新连接失败的机会。

The new DataSnap architecture isn't anymore based on COM (great!), but this way I lose the opportunity to stop the server without causing new connections to fail.

我认为某种TCP代理或隧道可以解决我的问题,因此我可以简单地将新服务器exe放在某个位置,并让代理将客户端连接重定向到新DS服务器。我尝试过TIdMappedPortTCP,但是它会连续挂在服务器-客户端对话框的随机点。

I've thought that a sort of TCP "proxy" or "tunnel" could solve my problem, so I can simply put a new server exe somewhere and have that "proxy" redirect client connections to the new DS server. I've tried TIdMappedPortTCP, but it continuously hangs at random points of the server-client dialog.

有什么想法吗?

编辑:出于效率考虑,我在纯TCP / IP传输上使用DataSnap,因此http代理不适合我的特定情况。

I'm using DataSnap on pure TCP/IP transport for efficiency reasons, so http proxies are not suitable for my specific case.

推荐答案

也许您应该看一下命名服务?可以像调用方法并返回主服务器的IP地址一样简单的Datasnap服务器。然后,当您要删除服务器进行维护时,可以更改命名服务器分发的IP地址,以便将新的客户端路由到该服务器。备份主服务器后,可以更改IP。

Maybe you should look at the equivalent of a naming service? Could be as simple as a Datasnap server that you make a method call on and returns the IP address of the "main" server. Then when you want to drop a server for maintenance you can change the IP address your naming server is handing out, so new clients get routed to it instead. When your main server is back up, you can change the IP back.

您仍然遇到引导问题(即,他们如何找到命名服务器的IP),但这很简单,就像在服务器中拥有几个IP地址一样客户端上的配置文件,如果第一个失败,则退回到第二个。

You still have the bootstrap problem (ie. how do they find the IP of the naming server) but this can be as simple as having a couple of IP addresses in a config file on the client and if the first one fails drop back to the second.

这篇关于如何将DataSnap客户端连接定向到各种DS Server?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆