Hi,
I use custom Facebook login. This flow:
Step 1. Client get access token from Facebook app.
Step 2. Send token to server.
Step 3. Server call Facebook API to check the token.
Step4. Server check OK. Send login OK to client.
Now, It run OK. But I want to ask about step 3. I should call Facebook API in new thread or in current login thread?
If I should call this Facebook API in new thread, how can I call send login OK to client when this thread complete?
Please, help me understand and implement this function clean and correct. Thank you!
Custom login with facebook.
Re: Custom login with facebook.
Hi,
if you're using a recent version of SFS2X (2.9 and higher) you can safely run the code in the Extension thread.
SFS2X 2.9 and higher uses auto load balancing thread pools so it will instantiate more threads if and when necessary and remove them when not needed anymore:
http://docs2x.smartfoxserver.com/Advanc ... oadBalance
If you have lots of concurrent logins you can change these parameter in the Thread Pool config (AdminTool > Server Configurator):
Backup threads: 64
Maximum backups: 32
cheers
if you're using a recent version of SFS2X (2.9 and higher) you can safely run the code in the Extension thread.
SFS2X 2.9 and higher uses auto load balancing thread pools so it will instantiate more threads if and when necessary and remove them when not needed anymore:
http://docs2x.smartfoxserver.com/Advanc ... oadBalance
If you have lots of concurrent logins you can change these parameter in the Thread Pool config (AdminTool > Server Configurator):
Backup threads: 64
Maximum backups: 32
cheers
Re: Custom login with facebook.
Hi, didnt you need to encrypt the access token key?
Who is online
Users browsing this forum: No registered users and 106 guests