private Task <int> SendPackage(LDFastMessageAdapter fastMsg) { int result = -1; Task <int> tsk = Task <int> .Run(new Func <int>(() => { result = sendConnectionAdapter.PubTopics("quote.realtime", fastMsg); return(result); })); return(tsk); }
/// <summary> /// 发送广播数据包的方法 /// </summary> /// <param name="fastMsg"></param> /// <param name="funcId"></param> /// <returns></returns> private Task <int> SendPubTopicsPackage(LDFastMessageAdapter fastMsg, string funcId) { int result = -1; Task <int> tsk = Task <int> .Run(() => { result = sendConnectionAdapter.PubTopics(funcId, fastMsg); fastMsg.FreeMsg(); return(result); }); return(tsk); }