Beispiel #1
0
        public override int run(string[] args)
        {
            shutdownOnInterrupt();
            IWindowLogger logger = UnityContainerHost.Container.Resolve <IWindowLogger>();

            try
            {
                string endpoint = string.Format("default:tcp -p {0}", SettingManager.GetInstance.DataServer.SubPort);
                _ic = communicator();
                ObjectAdapter adapter = _ic.createObjectAdapterWithEndpoints("AASDataServer", endpoint);

                IceDataService dataService = new IceDataService();
                adapter.add(dataService, _ic.stringToIdentity("AASDataServer/DataServant"));
                adapter.activate();
                _isRunning = true;
                logger.Warn(Title, "已启动!");
                _ic.waitForShutdown();
                if (interrupted())
                {
                    logger.Error(Title, "已中断!");
                    return(1);
                }
                logger.Warn(Title, "已停止!");
                _isRunning = false;
                return(0);
            }
            catch (System.Exception ex)
            {
                _isRunning = false;
                logger.Error(Title, "运行出错!", ex);
                return(1);
            }
        }
Beispiel #2
0
        public DataSourceServer()
        {
            IDataAdapter ds = new TDFDataAdapter();

            //IDataAdapter ds = new DataAdapter.TDB.TDBDataAdapter();
            ds.Setting = SettingManager.GetInstance.RealTimeAdapterSetting;

            _logger        = UnityContainerHost.Container.Resolve <IWindowLogger>();
            _iceDataServer = new IceDataServer();

            Init(ds);
        }
Beispiel #3
0
        public PubService()
        {
            _logger  = UnityContainerHost.Container.Resolve <IWindowLogger>();
            _context = new ZContext();

            _dataCount        = 0;
            _orderCount       = 0;
            _orderQueueCount  = 0;
            _transactionCount = 0;

            _dataCache        = new ConcurrentQueue <ZMessage>();
            _orderCache       = new ConcurrentQueue <ZMessage>();
            _orderQueueCache  = new ConcurrentQueue <ZMessage>();
            _transactionCache = new ConcurrentQueue <ZMessage>();

            _dataCacheGZip        = new ConcurrentQueue <ZMessage>();
            _orderCacheGZip       = new ConcurrentQueue <ZMessage>();
            _orderQueueCacheGZip  = new ConcurrentQueue <ZMessage>();
            _transactionCacheGZip = new ConcurrentQueue <ZMessage>();

            _fmt = new BinaryFormatter();

            _isRunning = false;
        }