Connection to SFS2X RC3

Post here your questions about the Objective-C API for SFS2X

Moderators: Lapo, Bax

Post Reply
ashutosh
Posts: 21
Joined: 01 Nov 2011, 22:26

Connection to SFS2X RC3

Post by ashutosh »

I was trying a new project and everything looks fine. My config.xml is correct. When I send connection request to server, it's being sent (I checked on server). However I am not getting any response, my onConnection event doesn't get fired.

I can this on console INFSmartFoxiPhoneClient:xmlReceived, however I checked the Node count and it was 0. So no event is getting fired.

Am I doing something wrong? I am not doing anything else right now beside connecting to server right now.

My console:

Code: Select all


2012-01-05 11:03:53.163 BlackJack-iOS[55070:fb03] INFSmartFoxiPhoneClient::loadConfig
2012-01-05 11:03:53.199 BlackJack-iOS[55070:fb03] INFSmartFoxiPhoneClient:connect ipAdr:smartfox.abc.com port:9933
2012-01-05 11:03:53.200 BlackJack-iOS[55070:fb03] INFSmartFoxiPhoneClient:initialize isLogOut:0
2012-01-05 11:03:53.317 BlackJack-iOS[55070:fb03] Event type: EventOpenCompleted
2012-01-05 11:03:53.318 BlackJack-iOS[55070:fb03] Event type: EventOpenCompleted
2012-01-05 11:03:53.319 BlackJack-iOS[55070:fb03] INFSmartFoxiPhoneClient:handleSocketConnection
2012-01-05 11:03:53.320 BlackJack-iOS[55070:fb03] INFSmartFoxiPhoneClient:send action:verChk fromRoom:0 message:<ver v='154' />
2012-01-05 11:03:53.321 BlackJack-iOS[55070:fb03] INFSmartFoxiPhoneClient:makeXmlHeader
2012-01-05 11:03:53.322 BlackJack-iOS[55070:fb03] INFSmartFoxiPhoneClient:closeHeader
2012-01-05 11:03:53.322 BlackJack-iOS[55070:fb03] INFSmartFoxiPhoneClient:writeToSocket data:<msg t='sys'><body action='verChk' r='0'><ver v='154' /></body></msg> len:70
2012-01-05 11:03:53.323 BlackJack-iOS[55070:fb03] WRITE - Creating a new buffer
2012-01-05 11:03:53.324 BlackJack-iOS[55070:fb03] Event type: EventHasSpaceAvailable
2012-01-05 11:03:53.325 BlackJack-iOS[55070:fb03] WRITE - Written directly to outStream len:70
2012-01-05 11:03:53.326 BlackJack-iOS[55070:fb03] Event type: EventHasSpaceAvailable
2012-01-05 11:03:53.327 BlackJack-iOS[55070:fb03] WRITE - No data to send
2012-01-05 11:03:53.422 BlackJack-iOS[55070:fb03] Event type: EventHasBytesAvailable
2012-01-05 11:03:53.423 BlackJack-iOS[55070:fb03] Read directly from inStream len:488
2012-01-05 11:03:53.424 BlackJack-iOS[55070:fb03] INFSmartFoxiPhoneClient:handleMessage
2012-01-05 11:03:53.425 BlackJack-iOS[55070:fb03] INFSmartFoxiPhoneClient:xmlReceived
2012-01-05 11:09:03.076 BlackJack-iOS[55070:fb03] Event type: EventHasBytesAvailable
2012-01-05 11:09:03.077 BlackJack-iOS[55070:fb03] Read directly from inStream len:0
2012-01-05 11:09:03.078 BlackJack-iOS[55070:fb03] No buffer!
2012-01-05 11:09:03.078 BlackJack-iOS[55070:fb03] Event type: EventEndOccured
2012-01-05 11:09:03.079 BlackJack-iOS[55070:fb03] INFSmartFoxiPhoneClient:handleSocketDisconnection
2012-01-05 11:09:03.080 BlackJack-iOS[55070:fb03] INFSmartFoxiPhoneClient:initialize isLogOut:0
[/code]
ashutosh
Posts: 21
Joined: 01 Nov 2011, 22:26

Node Count

Post by ashutosh »

Just in case, I wanted to show that xml received is empty.

Code: Select all

-[INFSmartFoxiPhoneClient xmlReceived:] [Line 352] Xml Node Count: 0
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Post by A51Integrated »

How are you connecting to the server? Can you provide the code? Also, try initializing your SFS Client using

Code: Select all

initSmartFoxWithDebugMode:YES
And see what that spits out.
A51 Integrated
http://a51integrated.com / +1 416-703-2300
ashutosh
Posts: 21
Joined: 01 Nov 2011, 22:26

Code

Post by ashutosh »

Hey, thanks for the reply.

I am initializing it like this:

Code: Select all

        [INFSmartFoxObjectSerializer setDebug:YES];
        smartFox = [INFSmartFoxiPhoneClient iPhoneClient:YES delegate:self];
        [smartFox loadConfig:@"config" autoConnect:YES];	
I have a project that works fine however it has old client API.
The way you are asking me to initialize, isn't it for iPhone client API RC1A?
I am using iPhone Client API RC4A.
Last edited by ashutosh on 05 Jan 2012, 22:01, edited 1 time in total.
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Post by A51Integrated »

If you're using an old API with a the RC3 server release, you're going to run into compatibility issues. Please update to the most current API for that project and try connecting again.
A51 Integrated
http://a51integrated.com / +1 416-703-2300
ashutosh
Posts: 21
Joined: 01 Nov 2011, 22:26

Post by ashutosh »

So previously I was using:

Server RC3
Client RC1a

Now (facing issue with this one)

Server RC3
Client RC4a.

The code you asked me to put in, isn't it for RC1a? Because in RC4a we initialize with

Code: Select all

[INFSmartFoxObjectSerializer setDebug:YES];
        smartFox = [INFSmartFoxiPhoneClient iPhoneClient:YES delegate:self];
        [smartFox loadConfig:@"config" autoConnect:YES];	
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Post by A51Integrated »

try:

Code: Select all

	smartFox = [[INFSmartFoxiPhoneClient alloc] initSmartFoxWithDebugMode:YES delegate:self];
	[smartFox loadConfig:@"config.xml" connectOnSuccess:YES];
A51 Integrated
http://a51integrated.com / +1 416-703-2300
ashutosh
Posts: 21
Joined: 01 Nov 2011, 22:26

Post by ashutosh »

Hey, I am sorry but the method

Code: Select all

smartFox = [[INFSmartFoxiPhoneClient alloc] initSmartFoxWithDebugMode:YES delegate:self];

belongs to api RC1a. There's no method like that in RC4a.
Only way to init in RC4a is

Code: Select all

smartFox = [INFSmartFoxiPhoneClient iPhoneClient:YES delegate:self];
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Post by A51Integrated »

The latest iPhone API is available here: http://forums.smartfoxserver.com/viewtopic.php?t=12231

Please have a look at the samples.
A51 Integrated
http://a51integrated.com / +1 416-703-2300
ashutosh
Posts: 21
Joined: 01 Nov 2011, 22:26

great

Post by ashutosh »

Cool, I will try this one. I downloaded iPhone client API from here: http://www.smartfoxserver.com/labs/API/

I guess the Aug API will work for sure. Thanks a lot!!
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: Connection to SFS2X RC3

Post by A51Integrated »

We just released a new API to go along with the SFS2X official release. Server can be found here:

http://www.smartfoxserver.com/download/ ... =installer

iOS API can be found here:

http://www.smartfoxserver.com/download/sfs2x#p=updates
A51 Integrated
http://a51integrated.com / +1 416-703-2300
Post Reply