如何使用Java中的特定IP和端口生成IOR

时间:2016-09-12 06:42:54

标签: java corba openorb

我正在调试Corba代码的服务器部分,我解码了生成的IOR,但是当我更改orb_init()时,ip没有改变。 以下是我的代码:

String[] args = new String[4];
            args[0] = "-ORBInitialPort";
            args[1] = "69455";
            args[2] = "-ORBInitialHost";
            args[3] = "127.0.0.1"; 
orb = org.omg.CORBA.ORB.init(args,null);
org.omg.CORBA.Object objPoa = orb.resolve_initial_references("RootPOA");
rootPOA = org.omg.PortableServer.POAHelper.narrow(objPoa);
org.omg.CORBA.Object obj = ((org.omg.PortableServer.Servant)this)._this_object(orb);
String1  = orb.object_to_string(obj);
java.io.FileOutputStream File = new java.io.FileOutputStream(IORFile);
java.io.PrintStream pfile=new java.io.PrintStream(File);
pfile.println(String1);

每次我更改IP:

args[2] = "-ORBInitialHost";
args[3] = "127.0.0.1";

它打印相同的ip和端口(3.222.123.22),下面是解码的ior内容:

_IIOP_ParseCDR:  byte order BigEndian, repository id <IDL:CfiSii:1.0>, 1 profile
_IIOP_ParseCDR:  profile 1 is 96 bytes, tag 0 (INTERNET), BigEndian byte order
(iiop.c:parse_IIOP_Profile):  bo=BigEndian, version=1.2, hostname=3.222.123.22, port=49630, object_key=<.OO.qU..W...POA.9...>
(iiop.c:parse_IIOP_Profile):  encoded object key is <%00OO%01qU%83%1CW%01%00%00POA%FE9%A4%AF%98>
(iiop.c:parse_IIOP_Profile):  non-native cinfo is <iiop_1_2_1_%2500OO%2501qU%2583%251CW%2501%2500%2500POA%25FE9%25A4%25AF%2598@tcp_3.222.123.22_49630>
object key is <#00OO#01qU#83#1CW#01#00#00POA#FE9#A4#AF#98>;
 no trustworthy most-specific-type info; unrecognized ORB type;
 reachable with IIOP 1.2 at host "3.222.123.22", port 49630

有人可以帮助我解决我所遗漏的问题或我需要做些什么,以便将更新的IP纳入IOR。

感谢。

0 个答案:

没有答案