maxmahem
Async events firing out of expected sequence.
Obviously I've got some assumptions wrong here but my thinking was that in these sets of methods would still fire in sequence:
this.service.StopAsync() calls...
And my thinking was that
StopService
would halt on that await
until StopAsync
returned, but it must not be so because the OnMessage
is firing after the dispose methods. So... something isn't right. I can probably turn StopAsync
synchronous but I'd rather figure out WTF is going on here.37 replies
Call from Invalid Thread possibly related to Avalonia
Getting a "Call from Invalid Thread" exception when running this chunk of code from an Avalonia context.
(excecption happens at
var tcpClient = await this.listener.AcceptTcpClientAsync(internalToken);
).
Doesn't happen when called from a CLI context.8 replies
Canceling TcpClient after TcpListener has been stopped
So, I may have done this completely right, but I'm a bit unsure on the behavior. I'm creating TcpClients with
AcceptTcpClientAsync
and passing it a CancellationToken
which does seem to end the TcpClients, but I guess I'm expecting to see a more graceful end in my TcpCleints which I am not.
To wit, I'm expecting to end up hitting client.Close
and then get the "Client disconnected" message, which isn't happening.48 replies