public async Task CreateClient_ShouldAcceptIncomingClient() { var client = await _socketManager.CreateClient(); _listener.VerifyAccept(); Assert.NotNull(client); }
public async Task Setup() { while (!_cts.IsCancellationRequested) { var client = await _socketManager.CreateClient(); var pipe = CreatePipe(client); var connection = new TConnection { Pipe = pipe, Parser = _frameParser }; await OnClientAccepted(connection); _ = connection.Setup() .ContinueWith(t => _onError(t.Exception?.InnerException), TaskContinuationOptions.OnlyOnFaulted) .ContinueWith(t => _socketManager.DestroyClient(client), TaskContinuationOptions.ExecuteSynchronously); } }