public override async Task ValidateConnectionAsync() { Logger.Info("Testing connection..."); IResponse testConnectResponse = await _binanceRestClient.TestConnectivityAsync(); if (testConnectResponse != null) { ServerTimeResponse serverTimeResponse = await _binanceRestClient.GetServerTimeAsync(); Logger.Info($"Connection was established successfully. Approximate ping time: {DateTime.UtcNow.Subtract(serverTimeResponse.ServerTime).TotalMilliseconds:F0} ms"); } }
private static async Task TestConnection(IBinanceRestClient binanceRestClient) { Logger.Info("Testing connection..."); IResponse testConnectResponse = await binanceRestClient.TestConnectivityAsync(); if (testConnectResponse != null) { ServerTimeResponse serverTimeResponse = await binanceRestClient.GetServerTimeAsync(); Logger.Info($"Connection is established. Approximate ping time: {DateTime.UtcNow.Subtract(serverTimeResponse.ServerTime).TotalMilliseconds:F0} ms"); } }