示例#1
0
        public QotGetSecuritySnapshot.Response GetSecuritySnapshotSync(ICollection <QotCommon.Security> secList)
        {
            ReqInfo reqInfo   = null;
            Object  syncEvent = new Object();

            lock (syncEvent)
            {
                lock (qotLock)
                {
                    if (qotConnStatus != ConnStatus.READY)
                    {
                        return(null);
                    }
                    QotGetSecuritySnapshot.C2S c2s = QotGetSecuritySnapshot.C2S.CreateBuilder()
                                                     .AddRangeSecurityList(secList)
                                                     .Build();
                    QotGetSecuritySnapshot.Request req = QotGetSecuritySnapshot.Request.CreateBuilder().SetC2S(c2s).Build();
                    uint sn = qot.GetSecuritySnapshot(req);
                    if (sn == 0)
                    {
                        return(null);
                    }
                    reqInfo = new ReqInfo(ProtoID.QotGetSecuritySnapshot, syncEvent);
                    qotReqInfoMap.Add(sn, reqInfo);
                }
                Monitor.Wait(syncEvent);
                return((QotGetSecuritySnapshot.Response)reqInfo.Rsp);
            }
        }
示例#2
0
 internal void RequestContractDetails(QotCommon.QotMarket market, string code)
 {
     QotGetSecuritySnapshot.Request.Builder reqBuilder   = QotGetSecuritySnapshot.Request.CreateBuilder();
     QotGetSecuritySnapshot.C2S.Builder     csReqBuilder = QotGetSecuritySnapshot.C2S.CreateBuilder();
     QotCommon.Security.Builder             stock        = QotCommon.Security.CreateBuilder();
     stock.SetCode(code);
     stock.SetMarket((int)market);
     csReqBuilder.AddSecurityList(stock);
     reqBuilder.SetC2S(csReqBuilder);
     qot.GetSecuritySnapshot(reqBuilder.Build());
 }