BlueBox is not work for js client?

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

zynbasil
Posts: 36
Joined: 23 May 2016, 03:59

BlueBox is not work for js client?

Postby zynbasil » 18 Jan 2018, 09:39

js client:
When I change wifi , connect will be lost.

c++ client:
Use bluebox ,change wifi, everything is fine

Help~

*********
http://docs2x.smartfoxserver.com/GettingStarted/bluebox
http://docs2x.smartfoxserver.com/api-do ... rtFox.html

Example
This example instantiates the SmartFox class passing a configuration object.

function init()
{
// Create configuration object
var config = {};
config.host = "127.0.0.1";
config.port = 8080;
config.useSSL = false;
config.zone = "BasicExamples";
config.debug = false;

// Create SmartFox client instance
sfs = new SFS2X.SmartFox(config);
}
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: BlueBox is not work for js client?

Postby Lapo » 18 Jan 2018, 15:23

Hi,
no the JS API does not support the BlueBox. However keep in mind that websockets are part of the HTTP protocol so if you run Jetty on a HTTP friendly port (such as 80 or 443) you'll never need the BlueBox.

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
zynbasil
Posts: 36
Joined: 23 May 2016, 03:59

Re: BlueBox is not work for js client?

Postby zynbasil » 19 Jan 2018, 09:57

I change server port to 80 & 443

It also disconnect when change wifi~

Any suggestion?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: BlueBox is not work for js client?

Postby Lapo » 19 Jan 2018, 10:12

The problem with WiFi is to be expected, and has nothing to do with the API.
It's a deeper issue with how networks works.Please read here:

http://smartfoxserver.com/blog/what-rea ... tworkwifi/
http://smartfoxserver.com/blog/handling ... e-devices/

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
zynbasil
Posts: 36
Joined: 23 May 2016, 03:59

Re: BlueBox is not work for js client?

Postby zynbasil » 19 Jan 2018, 14:11

But c++ client use bluebox, change WIFI , will not disconnect.
Why? Because bluebox?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: BlueBox is not work for js client?

Postby Lapo » 19 Jan 2018, 15:19

Yes,
the BlueBox uses HTTP which isn't dependent on a persistent connection. Every BBox call uses a separate HTTP connection, so it doesn't mind if you switch from WiFi to 3G/4G etc...

cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
zynbasil
Posts: 36
Joined: 23 May 2016, 03:59

Re: BlueBox is not work for js client?

Postby zynbasil » 19 Jan 2018, 15:55

Thanks :D

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 46 guests