public IWebsocketClient CreateClient() { var httpClient = _factory.CreateClient(); // This is needed since _factory.Server would otherwise be null var wsUri = new UriBuilder(_factory.Server.BaseAddress) { Scheme = "ws", Path = "ws" }.Uri; return(new WebsocketClient(wsUri, async(uri, token) => { NativeTestClient = _factory.Server.CreateWebSocketClient(); var ws = await NativeTestClient.ConnectAsync(uri, token).ConfigureAwait(false); await Task.Delay(1000, token); return ws; })); }
public IWebsocketClient CreateClient() { var httpClient = _factory.CreateClient(); // This is needed since _factory.Server would otherwise be null return(CreateClient(_factory.Server.BaseAddress)); }