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 に組み込むために必要なことを教えてください。
ありがとう。