Totally up to you whether you want to accept this, but I needed to make some of these changes so I figured I would see if you wanted them.
Reasons for the changes:
1) Net socket errors were never emitted, so if the initial connection failed, an error would be asynchronously thrown with no good way to catch it.
2) The isConnected state variable and the 'connect' event were being triggered regardless of it a connection was actually established. I left the 'connect' event that way just in case it's supposed to mean it's starting to connect
3) Deleted isReady since it didn't appear to be used anywhere
Totally up to you whether you want to accept this, but I needed to make some of these changes so I figured I would see if you wanted them.
Reasons for the changes: 1) Net socket errors were never emitted, so if the initial connection failed, an error would be asynchronously thrown with no good way to catch it. 2) The isConnected state variable and the 'connect' event were being triggered regardless of it a connection was actually established. I left the 'connect' event that way just in case it's supposed to mean it's starting to connect 3) Deleted isReady since it didn't appear to be used anywhere