Closed Eli-Black-Work closed 5 years ago
It's not meant to have a code
key – it can & when it is a ECONNREFUSED code, a reconnect will be attempted.
The onerror
(primarily) receives Events or ErrorEvents. It's the CloseEvent
(via onclose
) that will always have a numerical code
property. Sockette will reconnect if the connection was not closed with a code
of 1000 or 1005.
Hope that helps a bit~!
Thanks, @lukeed :)
Hello,
The documentation for
onerror
says "Important: If the event.code is ECONNREFUSED, an automatic reconnect attempt will be queued."However, when doing
onerror: e => console.log('Error:', e)
, it looks likee.code
doesn't exist.