Socket.IO-Client-Swift
Socket.IO-Client-Swift copied to clipboard
After client and engine close, the threads are still working
Why I cannot close completely?
private var mClient: SocketIOClient?
init( ... ) { mClient = SocketIOClient(socketURL: NSURL(string: host)!, options: [.Log(true), .ForcePolling(false)]) }
mClient?.removeAllHandlers() mClient?.disconnect() mClient = nil
After closed, my CPU is retaining 8%, and thread is not gone.
What thread
I found the root problem. My rootController presented the ViewController contains Socket, and After ViewController dismiss, my thread 1 retains some work causing CPU usage is 8%.
How should I do?