Skip to content

Direct OnClientDisconnected calls in connectionSetupTask #1054

@xPaw

Description

@xPaw

Like this:

connectionSetupTask = recordTask.ContinueWith( t =>
{
if ( token.IsCancellationRequested )
{
LogDebug( nameof( CMClient ), "Connection cancelled before a server could be chosen." );
OnClientDisconnected( userInitiated: true );
return;

This bypasses the normal Disconnect call which means some of the objects like connectionCancellation linger around. There's a call to Disconnect() in Connect, so there's no blocking, but if there wasn't it would just crash.

Not really sure what's a clean way to fix this up because Disconnect joins connectionSetupTask, so it would just dead lock.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions