burakoner / OKX.Api

Up-to-date, most-complete, well-organized, well-documented, easy-to-use, multi-task and multi-thread compatible OKX Cryptocurrency Exchange Rest and Websocket Api Wrapper
MIT License
39 stars 15 forks source link

OkxRestApiClient.Public functions hanging #59

Closed alekved closed 5 months ago

alekved commented 5 months ago

Updated the NuGet OKX.Api package to the latest version. Now the functions in the OkxRestApiClient.Public space are hanging. For example.

protected OkxRestApiClient _client = null;
OkxRestApiOptions roptions = new OkxRestApiOptions(new OkxApiCredentials(par.Username, par.Password, par.OkexPassPhrase));
roptions.BaseAddress = "https://okx.com";
roptions.DemoTradingService = par.IsDemo;
_client = new OkxRestApiClient(roptions);
RestCallResult<DateTime> wcr = null;
using (CancellationTokenSource cts = new CancellationTokenSource(5000))
{
    wcr = _client.Public.GetServerTimeAsync(cts.Token).Result;
}

The last call hangs. The same is with the GetCandlesticksAsync() method.

burakoner commented 5 months ago

I've copied your codes to me and worked

Screenshot 2024-04-04 131028

alekved commented 5 months ago

Thanks. It's weird. Probably something is wrong with the rest of my code. But all this stuff worked fine with the older versions of OKX.Api. I will double-check all.