Open
Description
Hey!
server.Start();
client.Connect();
Console.WriteLine(server.ListClients().Count());
await Task.Delay(1); // Thread.Sleep(1) also works
Console.WriteLine(server.ListClients().Count());
This will output:
0
1
This is very problematic as one might not expect server.ListClients()
to return an empty enumerable, especially if they're not aware of this issue.
I'm not sure why a 1ms delay seems to fix it. Are some async events (registering the client on server side) not awaited/fired on time or something?
Why does this happen and could it be fixed?