private static async Task SwitchUrl(IWebsocketClient client) { while (true) { await Task.Delay(10000); var production = new Uri("wss://localhost:8181"); var testnet = new Uri("wss://localhost:8182"); var selected = client.Url == production ? testnet : production; client.Url = selected; await client.Reconnect(); } }
private static async Task SwitchUrl(IWebsocketClient client) { while (true) { await Task.Delay(10000); var production = new Uri("wss://www.bitmex.com/realtime"); var testnet = new Uri("wss://testnet.bitmex.com/realtime"); var selected = client.Url == production ? testnet : production; client.Url = selected; await client.Reconnect(); } }
private async Task SwitchUrl(IWebsocketClient client, CancellationToken cancellation) { while (true) { await Task.Delay(200000); if (cancellation.IsCancellationRequested) { return; } client.Url = urlAuth; await client.Reconnect(); } }
public Task ReconnectAsync() { return(_client?.Reconnect()); }