Skip to content

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

@samuelgoldenbaum

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;
                
           ...

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions