<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:42.5pt 42.5pt 42.5pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="UK" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hello<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I have a problem with  accessing TAO Name Service.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Name Service is started as a service on Windows startup. Network interface is not initialized yet. As a result, Name Service IOR profile does not contain required endpoint(s).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I try to fix this problem in the following way:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">1. Register IOR Interceptor for TAO_Naming_Service<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">2. in method NSIORInterceptor ::components_established replace PortableInterceptor:: ObjectReferenceFactory by my own object.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">3. Override method ObjectReferenceFactory ::make_object.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">simplified  method make_object implementation<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">make_object (const char *interface_repository_id,   const PortableInterceptor::ObjectId & id)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">{<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  CORBA::Object_ptr object_ptr_orig =   this->old_factory_->make_object (interface_repository_id,  id);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  TAO_Stub* pStub = object_ptr_orig->_stubobj();<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  TAO_MProfile& mprofile = pStub->base_profiles();<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  TAO_IIOP_Profile *iiop_profile = // find the IIOP profile by tag IOP::TAG_INTERNET_IOP<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">// create new endpoint and add it to profile<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">ACE_NEW_RETURN (endpoint, TAO_IIOP_Endpoint ("10.20.30.40", 2001, IOP::TAG_ALTERNATE_IIOP_ADDRESS), 0);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">iiop_profile->add_endpoint (endpoint);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">// add several alternate endpoints<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">return object_ptr_orig;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Looks like it’s a wrong way or implementation is not completed, because resulting ior does not contain my added alternate address (check by tao_catior utility).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Question: How to add alternate addresses for IORs?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">In general I have to change IOR profiles each time when available network interfaces list is changed.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Any suggestion?<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="DA" style="color:black;mso-fareast-language:UK">Best regards</span><b><span lang="DA" style="color:black;mso-fareast-language:UK"><o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="DA" style="color:black;mso-fareast-language:UK">Andriy Ruzhevych<o:p></o:p></span></b></p>
</div>
</body>
</html>