Skip to content

cancel ConnectAsync when calling Disconnect #307

@dationguyen

Description

@dationguyen

Hi Team,

Thanks for doing an amazing job to maintain this library.

I have a question that is how can we stop ConnectAsync() while it's running?
In version 3.0.6 we can use Dispose() to trigger the cancellation token and cancel the ConnectAsync() before the timeout
but in the recent version 3.0.7, I notice that the Dispose() method no longer triggers the cancellation token which will let the ConnectAsync() retry forever.

Test case:

  • Call ConnectAsync while there is no network
  • It will keep retrying to connect
  • when want to close the app/ reset the socket io client ...etc -> no way to cancel the retrying
  • Call dispose(). the socket io still retrying to connect.

I would suggest adding back _cts.Cancel() to the Dispose method or on DisconnectAsync() to make sure we don't retry blindly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions