Beispiel #1
0
 public static CSTransDataFromClientPrx read__(IceInternal.BasicStream is__)
 {
     Ice.ObjectPrx proxy = is__.readProxy();
     if (proxy != null)
     {
         CSTransDataFromClientPrxHelper result = new CSTransDataFromClientPrxHelper();
         result.copyFrom__(proxy);
         return(result);
     }
     return(null);
 }
Beispiel #2
0
        public static CSTransDataFromClientPrx uncheckedCast(Ice.ObjectPrx b, string f)
        {
            if (b == null)
            {
                return(null);
            }
            Ice.ObjectPrx bb = b.ice_facet(f);
            CSTransDataFromClientPrxHelper h = new CSTransDataFromClientPrxHelper();

            h.copyFrom__(bb);
            return(h);
        }
Beispiel #3
0
        /// <summary>
        /// 初始化连接
        /// </summary>
        /// <returns></returns>
        public bool Init()
        {
            try
            {
                Ice.InitializationData intiData = new Ice.InitializationData();

                Ice.Properties properties = Ice.Util.createProperties();

                properties.setProperty("Ice.MessageSizeMax", "104857600");
                properties.setProperty("Ice.ThreadPool.SizeMax", "100");
                intiData.properties = properties;

                ic = Ice.Util.initialize(intiData);

                // 连接
                Ice.ObjectPrx objectPrx = ic.stringToProxy(string.Format("ID_TransDataFromClientRPC:tcp -h {0} -p {1} -t 5000",
                                                                         EEMSConfigHelper.GetValueByCommomConfig("config/CollectClient/DataServerIp", "127.0.0.1"),
                                                                         EEMSConfigHelper.GetValueByCommomConfig("config/CollectClient/DataServerPort", "40010")));

                Client = CSTransDataFromClientPrxHelper.checkedCast(objectPrx);
                // 代理
                Ice.ObjectAdapter adapter = ic.createObjectAdapterWithEndpoints("ID_TransDataFromClientRPC", string.Format("tcp -h {0} -p {1} -t 5000",
                                                                                                                           EEMSConfigHelper.GetValueByCommomConfig("config/CollectClient/DataClientIp", "127.0.0.1"),
                                                                                                                           EEMSConfigHelper.GetValueByCommomConfig("config/CollectClient/DataClientPort", "42000")));

                CallbackClientI callbackClientI = new CallbackClientI();

                callbackClientI.TransDataToClientHandler += callbackClientI_TransDataToClientHandler;

                Ice.Object obj = callbackClientI;

                adapter.add(obj, ic.stringToIdentity("ID_TransDataFromClientRPC"));

                adapter.activate();

                CallbackClientPrx call = CallbackClientPrxHelper.uncheckedCast(adapter.createProxy(ic.stringToIdentity("ID_TransDataFromClientRPC")));

                Client.RegistClient(ClientID, call, 1000);

                return(true);
            }
            catch (Exception e)
            {
                // 初始化失败
                Dispose();
                LogHelper.Instance.WirteErrorMsg(e.Message);
                return(false);
            }
        }
Beispiel #4
0
        public static CSTransDataFromClientPrx uncheckedCast(Ice.ObjectPrx b)
        {
            if (b == null)
            {
                return(null);
            }
            CSTransDataFromClientPrx r = b as CSTransDataFromClientPrx;

            if (r == null)
            {
                CSTransDataFromClientPrxHelper h = new CSTransDataFromClientPrxHelper();
                h.copyFrom__(b);
                r = h;
            }
            return(r);
        }
Beispiel #5
0
        public static CSTransDataFromClientPrx checkedCast(Ice.ObjectPrx b, _System.Collections.Generic.Dictionary <string, string> ctx)
        {
            if (b == null)
            {
                return(null);
            }
            CSTransDataFromClientPrx r = b as CSTransDataFromClientPrx;

            if ((r == null) && b.ice_isA(ice_staticId(), ctx))
            {
                CSTransDataFromClientPrxHelper h = new CSTransDataFromClientPrxHelper();
                h.copyFrom__(b);
                r = h;
            }
            return(r);
        }
Beispiel #6
0
 public static CSTransDataFromClientPrx checkedCast(Ice.ObjectPrx b, string f, _System.Collections.Generic.Dictionary <string, string> ctx)
 {
     if (b == null)
     {
         return(null);
     }
     Ice.ObjectPrx bb = b.ice_facet(f);
     try
     {
         if (bb.ice_isA(ice_staticId(), ctx))
         {
             CSTransDataFromClientPrxHelper h = new CSTransDataFromClientPrxHelper();
             h.copyFrom__(bb);
             return(h);
         }
     }
     catch (Ice.FacetNotExistException)
     {
     }
     return(null);
 }
Beispiel #7
0
 public static CSTransDataFromClientPrx checkedCast(Ice.ObjectPrx b, string f)
 {
     if (b == null)
     {
         return(null);
     }
     Ice.ObjectPrx bb = b.ice_facet(f);
     try
     {
         if (bb.ice_isA(ice_staticId()))
         {
             CSTransDataFromClientPrxHelper h = new CSTransDataFromClientPrxHelper();
             h.copyFrom__(bb);
             return(h);
         }
     }
     catch (Ice.FacetNotExistException)
     {
     }
     return(null);
 }