Exemplo n.º 1
0
        static List<String> GetTargetIP(Config cfg)
        {
            List<String> rets = new List<string>();

            String targetIPs = cfg.GetValue(TARGET_IP);

            String remain = targetIPs;

            while (remain.Length > 0)
            {
                String ip = remain.Substring(0, remain.IndexOf("|"));
                remain = remain.Substring(remain.IndexOf("|") + 1);
                remain = remain.Trim();
                rets.Add(ip);
            }
            return rets;
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Config cfg = new Config("config.txt");

            RtdCallBack callBack = new RtdCallBack(Program.CallBack);

            String kospiCode = cfg.GetValue(KOSPI_INDEX);
            String kospiFutureCode_1 = cfg.GetValue(KOSPI_FUTURE_INDEX_1);
            String kospiFutureCode_2 = cfg.GetValue(KOSPI_FUTURE_INDEX_2);

            String kospiFutureSpreadCode = cfg.GetValue(KOSPI_FUTURE_SPREAD);

            String usdKrwFutureCode_1 = cfg.GetValue(DOLLAR_FUTURE_INDEX_1);
            String usdKrwFutureCode_2 = cfg.GetValue(DOLLAR_FUTURE_INDEX_2);
            String usdKrwFutureSpreadCode = cfg.GetValue(DOLLAR_FUTURE_SPREAD);

            String bondFutureCode_1 = cfg.GetValue(KTB_FUTURE_INDEX_1);
            String bondFutureCode_2 = cfg.GetValue(KTB_FUTURE_INDEX_2);
            String bondFutureSpreadCode = cfg.GetValue(KTB_FUTURE_SPREAD);

            String spotBondCode = cfg.GetValue(KTB_SPOT_INDEX);

            List<String> targetIP = GetTargetIP(cfg);
            RegisterClient(targetIP);

            Register_KospiFuture(kospiFutureCode_1, callBack);
            Register_KospiFuture(kospiFutureCode_2, callBack);
            Register_KospiFuture(kospiFutureSpreadCode, callBack);

            Register_UsdKrw(usdKrwFutureCode_1, callBack);
            Register_UsdKrw(usdKrwFutureCode_2, callBack);
            Register_UsdKrw(usdKrwFutureSpreadCode, callBack);

            Register_BondFuture(bondFutureCode_1, callBack);
            Register_BondFuture(bondFutureCode_2, callBack);
            Register_BondFuture(bondFutureSpreadCode, callBack);

            Register_UsdKrwSpot("SEOULFX", "FXFUOE", "FXFUOD", callBack);
            Register_UsdKrwSpot("KOREAFX", "FXMUOE", "FXMUOD", callBack);
            Register_UsdKrwSpot("TOTALFX", "FXAFOE", "FXAFOD", callBack);

            Register_Bond(spotBondCode, callBack);
            Register_Kospi(kospiCode, callBack);

            while (true)
            {
                Console.Read();
            }
        }