SmartFox server : Connecting to the server
September 10th, 2009After a very horrible experience of using Red5 recently i recently started exploring SmartFox server.Must say that the initial expression is excellent.Server configurations are easy and development is straight forward.Also there is extensive help available on smartFox website. And the best thing is server is that unlike Red5, smartfox is not limited to flash action script.You can connect it to through .net,java and today i even connected it through objective-C.
Here is simple tutorial on how to connect and make connection to smartfox server.
1:Setting up connection String
1: var ip = "10.1.1.143";
2: var port = 9339;
3: var zone = "simpleChat";
2:Creating connection
1: //connect to server
2: var smartfox:SmartFoxClient = new SmartFoxClient(true);
3: smartfox.addEventListener(SFSEvent.onConnection, handleConnection);
4: smartfox.connect(ip, port);
3:Handling connection event
1: function handleConnection(evt:SFSEvent):void
2: {
3: var ok:Boolean = evt.params.success;
4: if (ok)
5: {
6: txt_window.text = "Connection succesfull!";
7: trace("Connection succesfull!");
8: }
9: else
10: {
11: txt_window.text = "Can't connect!";
12: trace("Can't connect!");
13: }
14: }
And that’s all you need to do to make connection to server and get the success/fail event.
This cup of tea was served by: Azeem’s Blog














Have your say,We have no comments yet.