Is it possible to load config using a resource URL instead of a filename? I have the app and xml in a jar file and want to use the class.getResource style of loading it.
Otherwise, can i skip loading from external XML and just set the connection props directly in API?
Thanks.
question about loadConfig
- A51Integrated
- Posts: 240
- Joined: 03 Jan 2012, 19:55
- Location: Toronto, Canada
- Contact:
Sure can. Just read through the docs for sfs2x.client.util.ConfigData. There are setters for all parameters.
Then call SmartFox.connect() directly.
Then call SmartFox.connect() directly.
A51 Integrated
http://a51integrated.com / +1 416-703-2300
http://a51integrated.com / +1 416-703-2300
I am getting a null value when doing this below. Why is that? It seems like a catch 22 if you need to call loadConfig on a xml that is not there. It seems like we don't support anything except using an xml file.
ConfigData cfg = sfs.getConfig();
cfg.setHost(serverIPTextField.getText());
cfg.setUdpHost(serverIPTextField.getText());
cfg.setPort(9933);
cfg.setUdpPort(9933);
ConfigData cfg = sfs.getConfig();
cfg.setHost(serverIPTextField.getText());
cfg.setUdpHost(serverIPTextField.getText());
cfg.setPort(9933);
cfg.setUdpPort(9933);
I was able to connect by doing this directly.
sfs.connect(serverIPTextField.getText(),9933);
Followed by sending the client loginrequest with the name and zone parameters.
I could not find any use for the ConfigData object. Even when creating a new ConfigData object explicitly.
The problem is after the connect, there is only the HANDSHAKE event from the server. There is no LOGIN of CONNECTION events fired despite registering for the callbacks on those events. The smartfox log shows a successful login.
Seems like some things are missing here.
sfs.connect(serverIPTextField.getText(),9933);
Followed by sending the client loginrequest with the name and zone parameters.
I could not find any use for the ConfigData object. Even when creating a new ConfigData object explicitly.
The problem is after the connect, there is only the HANDSHAKE event from the server. There is no LOGIN of CONNECTION events fired despite registering for the callbacks on those events. The smartfox log shows a successful login.
Seems like some things are missing here.
- A51Integrated
- Posts: 240
- Joined: 03 Jan 2012, 19:55
- Location: Toronto, Canada
- Contact:
Return to “SFS2X Java / Android API”
Who is online
Users browsing this forum: No registered users and 34 guests