C# API 問題

有任何提問的都來這
回覆文章
twken
文章: 2
註冊時間: 2023-05-02, 11:28

C# API 問題

文章 twken »

C# 抓即時行情會出現以下錯誤
我在call back 的函式試什麼都沒做也是會有錯誤.
觀察每天一開始是正常的, 當 "total_amount": 的數字太大很開始出錯

_api.SetQuoteCallback_v1(myCallBack);

void myCallBack(Exchange exchange, dynamic quote)
{
//MyEnv.log($"QuoteCB_v1 | Exchange.{exchange} {quote.GetType().Name} {quote}");
MyEnv.log("call back start ");
//stockDBA.SaveFuturesTicket(ConvertoVO(quote));
MyEnv.log("call back end ");
}

Warning - SessionImpl: 上午 11:09:15 | Client application threw an exception in message rx callback | Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot implicitly convert type 'uint' to 'int'. An explicit conversion exists (are you missing a cast?)
at CallSite.Target(Closure, CallSite, Object)
at Sinopac.Shioaji.TickFOPv1..ctor(Object data)
at CallSite.Target(Closure, CallSite, Type, Object)
at Sinopac.Shioaji.SolaceApi.ProcQuoteMsg(IMessage msg)
at Sinopac.Shioaji.Solace.HandleMessage(Object sender, MessageEventArgs args)
at SolaceSystems.Solclient.Messaging.Native.SessionImpl.Session_RxCallbackFuncV2(IntPtr opaqueSession, IntPtr opaqueMessage, IntPtr user)
twken
文章: 2
註冊時間: 2023-05-02, 11:28

Re: C# API 問題

文章 twken »

這是API 本身的 BUG 吧.
怎麼沒有人回應呢?
adam38577
文章: 1
註冊時間: 2023-09-12, 18:33

Re: C# API 問題

文章 adam38577 »

回覆文章