void SetCallBack() { _q.SetOnFrontConnected((DelegateOnFrontConnected)AddDele(new DelegateOnFrontConnected(CTPOnFrontConnected))); _q.SetOnRspUserLogin((DelegateOnRspUserLogin)AddDele(new DelegateOnRspUserLogin(CTPOnRspUserLogin))); _q.SetOnFrontDisconnected((DelegateOnFrontDisconnected)AddDele(new DelegateOnFrontDisconnected(CTPOnFrontDisconnected))); _q.SetOnRspSubMarketData((DelegateOnRspSubMarketData)AddDele(new DelegateOnRspSubMarketData(CTPOnRspSubMarketData))); _q.SetOnRtnDepthMarketData((DelegateOnRtnDepthMarketData)AddDele(new DelegateOnRtnDepthMarketData(CTPOnRtnDepthMarketData))); _q.SetOnRspError((DelegateOnRspError)AddDele(new DelegateOnRspError(CTPOnRspError))); }
static void Main(string[] args) { q = new CtpQuote("ctp_quote"); t = new CtpTrade("ctp_trade"); t.SetOnFrontConnected(t_connected); t.SetOnRspUserLogin(t_login); t.SetOnRtnTradingNotice(t_notice); q.SetOnFrontConnected(connected); q.SetOnRspUserLogin(login); t.RegisterFront("tcp://180.168.146.187:10000"); q.RegisterFront("tcp://180.168.146.187:10010"); t.Init(); q.Init(); Console.ReadLine(); }