Fix connect event always firing when trying to connect.
Created by: Neuheit
Summary
Fixes #587 (closed).
Details
This PR ensures that the WebSocket is actually connected by firing the Connected event only when a non-close message is received.
Changes proposed
- Made Connected fire only when a non-close message is received.
- Placed a few checks in the Receiver/Disconnected handlers to ensure
_isConnected
is properly set.