Socket.IO-Client-Swift icon indicating copy to clipboard operation
Socket.IO-Client-Swift copied to clipboard

After client and engine close, the threads are still working

Open KeChihYang opened this issue 9 years ago • 2 comments

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.

KeChihYang avatar Mar 30 '16 15:03 KeChihYang

What thread

nuclearace avatar Mar 30 '16 15:03 nuclearace

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?

KeChihYang avatar Mar 30 '16 15:03 KeChihYang