Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Disconnect and reconnect issue #67

Open
TimYi opened this issue Jan 24, 2018 · 3 comments
Open

Disconnect and reconnect issue #67

TimYi opened this issue Jan 24, 2018 · 3 comments

Comments

@TimYi
Copy link

TimYi commented Jan 24, 2018

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.

@JSteunou
Copy link
Owner

JSteunou commented Jul 3, 2018

Thanks for the find out. Would you mind opening a PR on this one?

@MorganTrench
Copy link

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?

Repository owner deleted a comment from MorganTrench Apr 16, 2019
@JSteunou
Copy link
Owner

You double posted your comment, I deleted the 2nd.

I'm sorry I do not clearly understand the last part of your question.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants