Skip to content
This repository was archived by the owner on Jul 31, 2020. It is now read-only.

Conversation

@acthomas06
Copy link
Contributor

Adds initial socket state of 'idle',
Only close if not idle or not reconnecting.

this.socket.close(1000, 'Closed normally.');
this.queue.forEach(packet => packet.cancel());
this.queue.clear();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want to set the state to Closed if the conditional fails, for cleanliness. Not sure if anything actually looks at it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good ;)

Copy link
Contributor

@ProbablePrime ProbablePrime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What connor said

this.queue.forEach(packet => packet.cancel());
this.queue.clear();
} else {
this.state = SocketState.Closing;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we mean "Closed" here, its not closing. its already closed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Websocket close is a three-way handshake, this starts it off but it doesn't complete until the close event is emitted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no 'Closed' state on the SocketState.

Idle, Connecting, Connected, Closing, Reconnecting, Refreshing

Happy to add a Closed state though :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, well. It would make sense to transition back to Idle. Functionally closed and idle would be identical. Ignore my previous comment, then 😛

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh understood, no this is fine as it is

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we can proceed with this as is? Or should I revert back to just the socket state init change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, revert the conditional else. Then good to go

@acthomas06 acthomas06 merged commit 6df5b40 into master Jun 6, 2017
@acthomas06 acthomas06 deleted the hotfix/interactive-to-browse branch June 6, 2017 00:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants