We detect client whether it is lose connection. If client lose connection, we use Sfsclient.connect again.
If connection is still not be establish, the job keep using Sfsclient.connect again.
We discover a Thread Pool created after using Sfsclient.connect.
So the worst situation is client program will be out of memory because there are so many Thread Pool that created by SfsClient in JVM.
Cloud you inspire me what is the explicit way to implement sfsclient reconnecting? No redundant thread pool existing .
When clinet connecting again, there is a new ThreadPool..
-
- Posts: 13
- Joined: 21 Feb 2018, 03:02
Re: When clinet connecting again, there is a new ThreadPool..
Hi,
when a client is disconnected you need to create a new SmartFox object so that the old one gets garbage collected.
To do this correctly you listen to the SFSEvent.CONNECTION_LOST and in the handler you remove all listeners before proceeding to create a new SmartFox instance.
Hope it helps
when a client is disconnected you need to create a new SmartFox object so that the old one gets garbage collected.
To do this correctly you listen to the SFSEvent.CONNECTION_LOST and in the handler you remove all listeners before proceeding to create a new SmartFox instance.
Hope it helps
-
- Posts: 13
- Joined: 21 Feb 2018, 03:02
Re: When clinet connecting again, there is a new ThreadPool..
Sorry, I known this is Java client forum here.
So does same methodology as Java to handle reconnecting when using JavaScript as client?
Thank you
So does same methodology as Java to handle reconnecting when using JavaScript as client?
Thank you
Re: When clinet connecting again, there is a new ThreadPool..
Yes, this applies to all supported API.
Cheers
Cheers
Return to “SFS2X Java / Android API”
Who is online
Users browsing this forum: No registered users and 26 guests