@@ -63,7 +63,7 @@ static void Main(string[] args)
6363 {
6464 //for (int i = 0; i < 10000; ++i)
6565 {
66- test_Linux_Main ( args ) ;
66+ test_KingstarStock_Main ( args ) ;
6767 }
6868 Console . ReadKey ( ) ;
6969 }
@@ -77,9 +77,9 @@ static void test_Linux_Main(string[] args)
7777 //XApi api = ApiManager.CreateApi(@"/home/hetao/works/QuantBox_XAPI/bin/Debug/libQuantBox_CTP_Quote.so");
7878 //XApi api2 = ApiManager.CreateApi(@"/home/hetao/works/QuantBox_XAPI/bin/Debug/libQuantBox_CTP_Trade.so");
7979
80- ApiManager . QueuePath = @"libQuantBox_Queue.so" ;
81- XApi api = ApiManager . CreateApi ( @"libQuantBox_CTP_Quote.so" ) ;
82- XApi api2 = ApiManager . CreateApi ( @"libQuantBox_CTP_Trade.so" ) ;
80+ // ApiManager.QueuePath = @"libQuantBox_Queue.so";
81+ XApi api = new XApi ( @"libQuantBox_CTP_Quote.so" ) ;
82+ XApi api2 = new XApi ( @"libQuantBox_CTP_Trade.so" ) ;
8383
8484 api . Server . BrokerID = "1017" ;
8585 api . Server . Address = "tcp://ctpmn1-front1.citicsf.com:51213" ;
@@ -115,17 +115,15 @@ static void test_Linux_Main(string[] args)
115115
116116 Thread . Sleep ( 10000 ) ;
117117 Console . WriteLine ( 123 ) ;
118- ApiManager . ReleaseApi ( api ) ;
119- ApiManager . ReleaseApi ( api2 ) ;
118+ api . Dispose ( ) ;
119+ api2 . Dispose ( ) ;
120120 }
121121
122122 #region LTS
123123 static void test_LTS_Main ( string [ ] args )
124124 {
125- Queue queue = new Queue ( @"QuantBox_Queue.dll" ) ;
126- Queue queue2 = new Queue ( @"QuantBox_Queue.dll" ) ;
127- XApi api = new XApi ( "QuantBox_LTS_Quote.dll" , queue ) ;
128- XApi api2 = new XApi ( "QuantBox_C2LTS_Trade.dll" , queue2 ) ;
125+ XApi api = new XApi ( "QuantBox_LTS_Quote.dll" ) ;
126+ XApi api2 = new XApi ( "QuantBox_C2LTS_Trade.dll" ) ;
129127
130128 api . Server . BrokerID = "2010" ;
131129 api . Server . Address = "tcp://211.144.195.163:44513" ;
@@ -169,8 +167,8 @@ static void test_LTS_Main(string[] args)
169167
170168 static void test_CTP_Main ( string [ ] args )
171169 {
172- ApiManager . QueuePath = @"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\QuantBox_Queue.dll" ;
173- api = ApiManager . CreateApi ( @"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\CTP\QuantBox_CTP_Trade.dll" ) ;
170+ // ApiManager.QueuePath = @"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\QuantBox_Queue.dll";
171+ api = new XApi ( @"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\CTP\QuantBox_CTP_Trade.dll" ) ;
174172
175173 api . Server . BrokerID = "1017" ;
176174 api . Server . Address = "tcp://ctpmn1-front1.citicsf.com:51205" ;
@@ -185,14 +183,37 @@ static void test_CTP_Main(string[] args)
185183
186184 Thread . Sleep ( 5 * 1000 ) ;
187185
188- ApiManager . ReleaseApi ( api ) ;
186+ api . Dispose ( ) ;
187+
188+ }
189+
190+ static void test_KingstarStock_Main ( string [ ] args )
191+ {
192+ //ApiManager.QueuePath = @"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\QuantBox_CTP_Trade.dll";
193+ api = new XApi ( @"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\KingstarStock\x86\QuantBox_KingstarStock_Trade.dll" ) ;
194+
195+ api . Server . BrokerID = "1017" ;
196+ api . Server . Address = "tcp://ctpmn1-front1.citicsf.com:51205" ;
197+
198+ api . User . UserID = "00000015" ;
199+ api . User . Password = "1234561" ;
200+
201+ api . OnConnectionStatus = OnConnectionStatus ;
202+ api . OnRtnDepthMarketData = OnRtnDepthMarketData ;
203+ api . OnRtnError = OnRtnError ;
204+
205+ api . Connect ( ) ;
206+
207+ Thread . Sleep ( 5 * 1000 ) ;
208+
209+ api . Dispose ( ) ;
189210
190211 }
191212
192213 static void test_KingstarGold_Main ( string [ ] args )
193214 {
194- ApiManager . QueuePath = @"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\QuantBox_Queue.dll" ;
195- api = ApiManager . CreateApi ( @"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\KingstarGold\QuantBox_KingstarGold.dll" ) ;
215+ // ApiManager.QueuePath = @"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\QuantBox_Queue.dll";
216+ api = new XApi ( @"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\KingstarGold\QuantBox_KingstarGold.dll" ) ;
196217
197218 api . Server . BrokerID = "" ;
198219 api . Server . Address = "tcp://124.74.239.38:18961" ;
@@ -210,7 +231,7 @@ static void test_KingstarGold_Main(string[] args)
210231
211232 Console . ReadKey ( ) ;
212233
213- ApiManager . ReleaseApi ( api ) ;
234+ api . Dispose ( ) ;
214235
215236 Console . ReadKey ( ) ;
216237
0 commit comments