Is it possible for a client to access the IMR to get the host name of the servers?
客户端是否可以访问IMR以获取服务器的主机名?
2 个解决方案
#1
Even what tuergeist suggests (the host address) isn't necessarily where a server is running. First and foremost, the server may not actually be running but may still be registered with the IMR. Second, the host name may map to many IP addresses; an IP address may resolve to multiple machines using some sort of additional fault-tolerance network layer. Finally, if CORBA's Fault Tolerant spec is combined with IMR, then there's another level of indirection.
即使是tuergeist建议(主机地址)也不一定是服务器运行的地方。首先,服务器可能实际上并未运行,但仍可能在IMR中注册。其次,主机名可以映射到许多IP地址;使用某种额外的容错网络层,IP地址可以解析为多台计算机。最后,如果CORBA的Fault Tolerant规范与IMR结合,那么还有另一个间接层。
The question raised by teurgeist is the most appropriate, and the advice of not adding location-dependent services is sage.
teurgeist提出的问题是最合适的,不添加依赖于位置的服务的建议就是圣人。
As a footnote, relying on any IMR behavior is also bad, because the IMR is one of the most underspecified aspects of the CORBA spec. Basically, it ends up saying, "a vendor can provide one, and here are the kinds of things it can do". That's about it. So, if you rely on specific behaviors or specific APIs, you've instantly tied yourself to one vendor's specific implementation of the IMR.
作为脚注,依赖任何IMR行为也很糟糕,因为IMR是CORBA规范中最不明确的方面之一。基本上,它最终会说,“供应商可以提供一个,这里有它可以做的事情”。就是这样。因此,如果您依赖于特定行为或特定API,您可以立即将自己与一个供应商的IMR特定实现联系起来。
#2
This is possible indirectly. As you'll receive a "location forward" from the IMR (implementation repository). Your ORB must be able to extract the host's address from the object redirection.
这可能是间接的。因为您将从IMR(实施存储库)收到“位置转发”。您的ORB必须能够从对象重定向中提取主机的地址。
The question is: What do you want to do with this information?
问题是:你想用这些信息做什么?
CORBA is (shall be) location transparent... Thus, do not add location dependent services!
CORBA(应该)位置透明...因此,不要添加位置相关的服务!
#1
Even what tuergeist suggests (the host address) isn't necessarily where a server is running. First and foremost, the server may not actually be running but may still be registered with the IMR. Second, the host name may map to many IP addresses; an IP address may resolve to multiple machines using some sort of additional fault-tolerance network layer. Finally, if CORBA's Fault Tolerant spec is combined with IMR, then there's another level of indirection.
即使是tuergeist建议(主机地址)也不一定是服务器运行的地方。首先,服务器可能实际上并未运行,但仍可能在IMR中注册。其次,主机名可以映射到许多IP地址;使用某种额外的容错网络层,IP地址可以解析为多台计算机。最后,如果CORBA的Fault Tolerant规范与IMR结合,那么还有另一个间接层。
The question raised by teurgeist is the most appropriate, and the advice of not adding location-dependent services is sage.
teurgeist提出的问题是最合适的,不添加依赖于位置的服务的建议就是圣人。
As a footnote, relying on any IMR behavior is also bad, because the IMR is one of the most underspecified aspects of the CORBA spec. Basically, it ends up saying, "a vendor can provide one, and here are the kinds of things it can do". That's about it. So, if you rely on specific behaviors or specific APIs, you've instantly tied yourself to one vendor's specific implementation of the IMR.
作为脚注,依赖任何IMR行为也很糟糕,因为IMR是CORBA规范中最不明确的方面之一。基本上,它最终会说,“供应商可以提供一个,这里有它可以做的事情”。就是这样。因此,如果您依赖于特定行为或特定API,您可以立即将自己与一个供应商的IMR特定实现联系起来。
#2
This is possible indirectly. As you'll receive a "location forward" from the IMR (implementation repository). Your ORB must be able to extract the host's address from the object redirection.
这可能是间接的。因为您将从IMR(实施存储库)收到“位置转发”。您的ORB必须能够从对象重定向中提取主机的地址。
The question is: What do you want to do with this information?
问题是:你想用这些信息做什么?
CORBA is (shall be) location transparent... Thus, do not add location dependent services!
CORBA(应该)位置透明...因此,不要添加位置相关的服务!