Open TimYi opened 6 years ago
Thanks for the find out. Would you mind opening a PR on this one?
I'm looking into a problem I'm encountering and I'm unsure if this is related.
I know WebSocket.send() closes the socket if the data cannot be sent (https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send), so I can see onClose being invoked before intended, but where/how does it "wait for a receipt" before cleanup?
You double posted your comment, I deleted the 2nd.
I'm sorry I do not clearly understand the last part of your question.
I read the source code to get a better knowledge of auto reconnect. I found that disconnect method sends a 'DISSCONNECT' frame and wait for a receipt before cleanup and close websocket. There may be chances that websocket onClose is invoked when doing disconnect, so I think a disconnecting flag should be added to handle this situation.