Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop sockjs from multiplying on reconnect #888

Merged
merged 2 commits into from May 11, 2015

Conversation

markwal
Copy link
Member

@markwal markwal commented May 11, 2015

Have you ever noticed when developing that every time you stop and start
the server, the terminal window gets an extra duplicate line for every
reconnect attempt? Well, it's because (I think) "delete" in javascript
just removes the indicated name from the namespace, it doesn't actually
free up an object. Those zombie objects are still there and wake up (for
some transports) on reconnect. Might be different in SockJS v1 or later.

Anyway, this fixes it for me in Chrome.

Have you ever noticed when developing that every time you stop and start
the server, the terminal window gets an extra duplicate line for every
reconnect attempt?  Well, it's because (I think) "delete" in javascript
just removes the indicated name from the namespace, it doesn't actually
free up an object. Those zombie objects are still there and wake up (for
some transports) on reconnect. Might be different in SockJS v1 or later.
@nophead
Copy link
Contributor

nophead commented May 11, 2015

Yes I have seen the terminal lines get duplicated, then triplicated, etc.
Not developing though, just using OctopPrint.

On 11 May 2015 at 03:03, Mark Walker notifications@github.com wrote:

Have you ever noticed when developing that every time you stop and start
the server, the terminal window gets an extra duplicate line for every
reconnect attempt? Well, it's because (I think) "delete" in javascript
just removes the indicated name from the namespace, it doesn't actually
free up an object. Those zombie objects are still there and wake up (for
some transports) on reconnect. Might be different in SockJS v1 or later.

Anyway, this fixes it for me in Chrome.

You can view, comment on, or merge this pull request online at:

#888
Commit Summary

  • Stop sockjs from multiplying on reconnect

File Changes

Patch Links:

Reply to this email directly or view it on GitHub
#888.

See https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
WebSocket defines 1000 as CLOSE_NORMAL, SockJS uses it without
a name and doesn't provide one for us, so for now we define our own
foosel added a commit that referenced this pull request May 11, 2015
@foosel foosel merged commit c8b8bcb into OctoPrint:devel May 11, 2015
@markwal markwal deleted the sockjslikebunnies branch May 11, 2015 21:01
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants