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

Websocket: replaced time.Ticker with sleep for avoid memory leak #792

Merged
merged 1 commit into from Oct 20, 2017
Merged

Websocket: replaced time.Ticker with sleep for avoid memory leak #792

merged 1 commit into from Oct 20, 2017

Conversation

jerson
Copy link
Contributor

@jerson jerson commented Oct 20, 2017

see issue #791

Copy link
Owner

@kataras kataras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jerson thanks for that but I already know that and I have to notice that;

Tick is a convenience wrapper for NewTicker providing access to the ticking channel only. Note that this leaks associated resources; use NewTicker and Stop to avoid that.

Iris websocket doesn't use the Tick method inside the connection.go , we use the channel as it's, so we don't have the problem you described, we also Stop it, look:

https://github.com/kataras/iris/blob/master/websocket/connection.go#L307
and for Stop ; https://github.com/kataras/iris/blob/master/websocket/server.go#L382

@kataras kataras closed this Oct 20, 2017
@kataras kataras reopened this Oct 20, 2017
@kataras kataras merged commit 6aecdd4 into kataras:master Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants