Client-side, I try running SmartFoxClient.connect([my ip], 9339);
After the line with connect, nothing runs and the listener SFSEvent.onConnection is never called. If someone has successfully connected to SFS in Haxe, please help.
Code: Select all
import it.gotoandplay.smartfoxserver.SmartFoxClient;
import it.gotoandplay.smartfoxserver.SFSEvent;
class New {
public static function main() {
var sfs = new SmartFoxClient(true);
haxe.Log.trace(sfs.properties);
sfs.addEventListener(SFSEvent.onConnection, function(e:SFSEvent) {
haxe.Log.trace("Listener called: " + sfs.getConnectionMode);
if(e.params.success) {
haxe.Log.trace("Success");
}
else {
haxe.Log.trace("Success");
}
});
try{
haxe.Log.trace("Connecting Started..");
sfs.connect("192.168.1.229", 9339); //my ip is 192.168.1.229 on the internal server. Tried with "127.0.0.1" and got the same result
haxe.Log.trace("Connecting...");
}
catch(e:String) {
haxe.Log.trace("Failed");
}
haxe.Log.trace("Connection Sent..................");
}
}
I compile with haxe -main New -swf whatever.swf -swf-lib SmartFoxClient.swf -swf-lib SFSEvent.swf
The compilation runs fine, but the output of the traces is only sfs.properties(which is null) and "Connecting Started.."
Note: it connectss fine in AS3, so I assume the problem is with the included swf-lib in haxe.
This is somewhat urgent as the project submission is in a few days.
Edit: I probably should have posted this thread in the client discussion. Sorry about that.