Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ internal sealed class State
// Backlog limit is managed by MsQuic so it can be unbounded here.
public readonly Channel<MsQuicStream> AcceptQueue = Channel.CreateUnbounded<MsQuicStream>(new UnboundedChannelOptions()
{
SingleReader = true,
SingleWriter = true,
Comment thread
wfurt marked this conversation as resolved.
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,35 @@ await RunClientServer(
);
}

[Fact]
public async Task MultipleConcurrentStreamsOnSingleConnection()
{
const int count = 100;
Task[] tasks = new Task[count];

(QuicConnection clientConnection, QuicConnection serverConnection) = await CreateConnectedQuicConnection();
using (clientConnection)
using (serverConnection)
{
for (int i = 0; i < count; i++)
{
tasks[i] = MakeStreams(clientConnection, serverConnection);
}
await tasks.WhenAllOrAnyFailed(PassingTestTimeoutMilliseconds);
}

static async Task MakeStreams(QuicConnection clientConnection, QuicConnection serverConnection)
{
byte[] buffer = new byte[64];
QuicStream clientStream = clientConnection.OpenBidirectionalStream();
ValueTask writeTask = clientStream.WriteAsync(Encoding.UTF8.GetBytes("PING"), endStream: true);
ValueTask<QuicStream> acceptTask = serverConnection.AcceptStreamAsync();
await new Task[] { writeTask.AsTask(), acceptTask.AsTask()}.WhenAllOrAnyFailed(PassingTestTimeoutMilliseconds);
QuicStream serverStream = acceptTask.Result;
await serverStream.ReadAsync(buffer);
}
}

[Fact]
public async Task GetStreamIdWithoutStartWorks()
{
Expand Down