Skip to content

Ability to reset State in HubConnection.ConnectAsync() #6

Description

@samuelgoldenbaum

Currently, there is no way to reset State when connecting. This is not ideal as it means we have to initialize a new HubConnection instance every time we connect and then bind to new handlers. This becomes prevalent when attempting initial connection retries in a loop.

I think default parameter here could be useful like:

public Task<HubConnection> ConnectAsync(bool resetState = false) {
            if (resetState)
                this.State = ConnectionStates.Initial;
                
           ...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions