sockjsHandler creates a new kite.Client object for each sockjs.Session. Handler and session end their life when blocking readLoop() method returns. This means that created kite.Client is no longer needed. However, it can't be GC because sendHub() still waits for incoming data from readLoop() which, as was written above, already returned.
This change closes created kite.Client when it's no longer needed. Closing it will also stop sendHub() go-routine.
sockjsHandler
creates a newkite.Client
object for eachsockjs.Session
. Handler and session end their life when blockingreadLoop()
method returns. This means that createdkite.Client
is no longer needed. However, it can't be GC becausesendHub()
still waits for incoming data fromreadLoop()
which, as was written above, already returned.This change closes created
kite.Client
when it's no longer needed. Closing it will also stopsendHub()
go-routine.