Ejemplo n.º 1
0
        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");
            }
        }
Ejemplo n.º 2
0
        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");
            }
        }