Ejemplo n.º 1
0
 public void OnInitConnect(FTAPI_Conn client, long errCode, string desc)
 {
     Console.WriteLine("InitConnected");
     if (errCode == 0)
     {
         FTAPI_Qot qot = client as FTAPI_Qot;
         {
             GetGlobalState.Request req = GetGlobalState.Request.CreateBuilder().SetC2S(GetGlobalState.C2S.CreateBuilder().SetUserID(900019)).Build();
             uint serialNo = qot.GetGlobalState(req);
             Console.WriteLine("Send GetGlobalState: {0}", serialNo);
         }
         //这样连续的发消息是不太好的,容易占满缓冲区。
         {
             QotSub.Request.Builder     reqBuilder   = QotSub.Request.CreateBuilder();
             QotSub.C2S.Builder         csReqBuilder = QotSub.C2S.CreateBuilder();
             QotCommon.Security.Builder stock        = QotCommon.Security.CreateBuilder();
             stock.SetCode("00823");
             stock.SetMarket((int)QotCommon.QotMarket.QotMarket_HK_Security);
             csReqBuilder.AddSecurityList(stock);
             csReqBuilder.AddSubTypeList((int)QotCommon.SubType.SubType_Ticker);
             csReqBuilder.SetIsSubOrUnSub(true);
             csReqBuilder.SetIsRegOrUnRegPush(true);
             reqBuilder.SetC2S(csReqBuilder);
             //uint serialNo = qot.Sub(reqBuilder.Build());
             //Console.WriteLine("Send Sub: {0}", serialNo);
         }
     }
 }
Ejemplo n.º 2
0
            void SendGetGlobalState(FTAPI_Qot qot)
            {
                GetGlobalState.Request req = GetGlobalState.Request.CreateBuilder().SetC2S(GetGlobalState.C2S.CreateBuilder().SetUserID(900019)).Build();
                uint serialNo = qot.GetGlobalState(req);

                Console.WriteLine("SendGetGlobalState: {0}", serialNo);
            }
Ejemplo n.º 3
0
 public void OnInitConnect(FTAPI_Conn client, long errCode, string desc)
 {
     Console.WriteLine("InitConnected");
     if (errCode == 0)
     {
         FTAPI_Qot qot = client as FTAPI_Qot;
         {
             GetGlobalState.Request req = GetGlobalState.Request.CreateBuilder().SetC2S(GetGlobalState.C2S.CreateBuilder().SetUserID(900019)).Build();
             uint serialNo = qot.GetGlobalState(req);
             Console.WriteLine("Send GetGlobalState: {0}", serialNo);
         }
         ftClient.IsConnected = true;
     }
     else
     {
         ftClient.FTController.ibClient_Error(null, 0, 0, ((ConnectFailType)errCode).ToString());
     }
 }