Ejemplo n.º 1
0
        /// <summary>gets a reference to the init service running at the specified host at the specified port</summary>
        private CORBAInitService GetInitService(string host, int port)
        {
            lock (m_initalServices.SyncRoot) {
                CORBAInitService initService = null;
                string           key         = host + ":" + port;
                if (!m_initalServices.ContainsKey(key))
                {
                    IorProfile initServiceProfile =
                        new InternetIiopProfile(new GiopVersion(1, 0),
                                                host, (ushort)port,
                                                IorUtil.GetKeyBytesForId(CORBAInitServiceImpl.INITSERVICE_NAME));
                    // don't add a codeset component, because giop 1.0
                    Ior initServiceIor = new Ior(Repository.GetRepositoryID(typeof(CORBAInitService)),
                                                 new IorProfile[] { initServiceProfile });

                    string iorString = initServiceIor.ToString();
                    initService = (CORBAInitService)RemotingServices.Connect(typeof(CORBAInitService),
                                                                             iorString); // CORBAInitService type not verifiable remote -> make sure that it's possible to verify locally
                    m_initalServices.Add(key, initService);
                }
                else
                {
                    initService = (CORBAInitService)m_initalServices[key];
                }
                return(initService);
            }
        }
Ejemplo n.º 2
0
 public RmiIiopInit(string host, int port) {
     m_initService = GetInitService(host, port);
 }
Ejemplo n.º 3
0
 public RmiIiopInit(string host, int port)
 {
     m_initService = GetInitService(host, port);
 }