Hi,
If I load a config file, then connect, everything works as expected:
<SmartFoxConfig>
<ip>127.0.0.1</ip>
<port>9933</port>
<zone>bunco1</zone>
<debug>false</debug>
</SmartFoxConfig>
Load this config, then call _sf.connect();
It connects as expected and triggers the callback.
While if I prepare a ConfigData object with the same exact parameters, then call connectWithConfig(), nothing happens, no callback is received:
var configObj :ConfigData = new ConfigData();
configObj.port = "127.0.0.1";
configObj.port = 9933;
configObj.zone = "bunco1";
configObj.debug = false;
_sf.connectWithConfig (configObj);
Am I missing something?
Thank you
PS
Using AS3 API 1.7.5
connectWithConfig() not working as expected.
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
Re: connectWithConfig() not working as expected.
var configObj :ConfigData = new ConfigData();
configObj.port = "127.0.0.1";
configObj.port = 9933;
You're assigning the port value twice and never assign the host value... that might be a problem.
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
Re: connectWithConfig() not working as expected.
That was a typo when pasting on forum, in code it's correct.
var configObj :ConfigData = new ConfigData();
configObj.host = "127.0.0.1";
configObj.port = 9933;
configObj.zone = "bunco1";
configObj.debug = false;
_sf.connectWithConfig (configObj);
Nothing happens. While using the exact same parameters loading an XML config it triggers events.
var configObj :ConfigData = new ConfigData();
configObj.host = "127.0.0.1";
configObj.port = 9933;
configObj.zone = "bunco1";
configObj.debug = false;
_sf.connectWithConfig (configObj);
Nothing happens. While using the exact same parameters loading an XML config it triggers events.
Re: connectWithConfig() not working as expected.
If "nothing happens" I'd recommend testing your app inside Flash/Flash Builder and see exactly what is going on. Likely an exception.
Nothing happening is not expected
Nothing happening is not expected
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
Re: connectWithConfig() not working as expected.
I am testing my app in Flash CC ide and/or with Scout running. It puzzles me too, no callback, no exception, app sits waiting for a callback forever until a client custom timeout is triggered.
Same exact flow, using external config file, connection event is triggered and app continues.
Same exact flow, using external config file, connection event is triggered and app continues.
Re: connectWithConfig() not working as expected.
Turn on the debug in the ConfigData object and see if you get output in the logs...
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
Re: connectWithConfig() not working as expected.
Thanks I'll try that.
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
Re: connectWithConfig() not working as expected.
I tried with debug true, same behaviour, here are the results:
10 apr 2017 | 19:40:12,146 | INFO | SocketReader | bitswarm.sessions.DefaultSessionManager | | Session created: { Id: 1, Type: DEFAULT, Logged: No, IP: 127.0.0.1:50162 } on Server port: 9933 <---> 50162
10 apr 2017 | 19:40:34,910 | INFO | SocketReader | bitswarm.sessions.DefaultSessionManager | | Session removed: { Id: 1, Type: DEFAULT, Logged: No, IP: 127.0.0.1:50162 }
With debug on, these are the last 2 entries in log.
First one is when I connect, second one, 20 seconds later, when I close the client. The onConnection event still not triggered.
This is the code:
Again, same exact settings with external sfsconfig.xml trigger the onConnection event.
Same settings with external, onConnection event is triggered, app can login and so on...
10 apr 2017 | 19:52:58,364 | INFO | SocketReader | bitswarm.sessions.DefaultSessionManager | | Session created: { Id: 21, Type: DEFAULT, Logged: No, IP: 127.0.0.1:50229 } on Server port: 9933 <---> 50229
10 apr 2017 | 19:52:58,474 | INFO | SFSWorker:Ext:1 | Extensions | | {bunco}: LoginHandler: loginType = fbaL
etc. etc.
10 apr 2017 | 19:40:12,146 | INFO | SocketReader | bitswarm.sessions.DefaultSessionManager | | Session created: { Id: 1, Type: DEFAULT, Logged: No, IP: 127.0.0.1:50162 } on Server port: 9933 <---> 50162
10 apr 2017 | 19:40:34,910 | INFO | SocketReader | bitswarm.sessions.DefaultSessionManager | | Session removed: { Id: 1, Type: DEFAULT, Logged: No, IP: 127.0.0.1:50162 }
With debug on, these are the last 2 entries in log.
First one is when I connect, second one, 20 seconds later, when I close the client. The onConnection event still not triggered.
This is the code:
Code: Select all
_sf.addEventListener (SFSEvent.CONNECTION, onConnection);
_sf.addEventListener (SFSEvent.CONNECTION_LOST, onConnectionLost);
var configObj :ConfigData = new ConfigData();
configObj.host = "127.0.0.1";
configObj.port = 9933;
configObj.zone = "bunco1";
configObj.debug = true;
_sf.connectWithConfig (configObj);
Again, same exact settings with external sfsconfig.xml trigger the onConnection event.
Same settings with external, onConnection event is triggered, app can login and so on...
10 apr 2017 | 19:52:58,364 | INFO | SocketReader | bitswarm.sessions.DefaultSessionManager | | Session created: { Id: 21, Type: DEFAULT, Logged: No, IP: 127.0.0.1:50229 } on Server port: 9933 <---> 50229
10 apr 2017 | 19:52:58,474 | INFO | SFSWorker:Ext:1 | Extensions | | {bunco}: LoginHandler: loginType = fbaL
etc. etc.
Re: connectWithConfig() not working as expected.
Can you send us a proof of concept that reproduces the issue? You can zip it and send it to our support@... email box with a reference to this discussion.
Thanks
Thanks
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
Re: connectWithConfig() not working as expected.
Hi Lapo,
This problem also happens exactly the same in this situation:
1 - load external sfsconfig.xml
2 - connect (with server switched off)
3 - connection error event is triggered
4 - launch server
5 - connect again
It stalls exactly like in previous situation.
I have tried also re-loading config file, but it stalls anyway.
It's not easy to send you the whole server/client flow, game is already at an advanced state.
Did this ever happened in the past?
cheers
Pippo
This problem also happens exactly the same in this situation:
1 - load external sfsconfig.xml
2 - connect (with server switched off)
3 - connection error event is triggered
4 - launch server
5 - connect again
It stalls exactly like in previous situation.
I have tried also re-loading config file, but it stalls anyway.
It's not easy to send you the whole server/client flow, game is already at an advanced state.
Did this ever happened in the past?
cheers
Pippo
Re: connectWithConfig() not working as expected.
I asked for an example because we cannot reproduce the first issue you have reported in any way shape or form.
Here's another idea.
Take any example from our "Flash Example pack" such as the SimpleChat. Can you reproduce the 1st problem you have posted there?
If the connection fails, you will need to re-do everything from scratch, which means:
1) recreate the SmartFox object
2) reload the XML
Here's another idea.
Take any example from our "Flash Example pack" such as the SimpleChat. Can you reproduce the 1st problem you have posted there?
This problem also happens exactly the same in this situation:
1 - load external sfsconfig.xml
2 - connect (with server switched off)
3 - connection error event is triggered
4 - launch server
5 - connect again
It stalls exactly like in previous situation.
I have tried also re-loading config file, but it stalls anyway.
If the connection fails, you will need to re-do everything from scratch, which means:
1) recreate the SmartFox object
2) reload the XML
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
Re: connectWithConfig() not working as expected.
Thx I will try that.
Is there any GC friendly advice to dispose previous Smartfox object?
Is there any GC friendly advice to dispose previous Smartfox object?
Re: connectWithConfig() not working as expected.
We have never encountered any issues with GC in Flash.
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
Return to “SFS2X ActionScript 3 API”
Who is online
Users browsing this forum: No registered users and 20 guests