Connection to SFS2X RC3

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

Moderators: Lapo, Bax

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

Connection to SFS2X RC3

Postby ashutosh » 05 Jan 2012, 20:11

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

Postby ashutosh » 05 Jan 2012, 21:01

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

Code: Select all

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

Postby A51Integrated » 05 Jan 2012, 21:09

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

Postby ashutosh » 05 Jan 2012, 21:58

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.
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Postby A51Integrated » 05 Jan 2012, 22:01

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

Postby ashutosh » 05 Jan 2012, 22:05

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];   
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Postby A51Integrated » 05 Jan 2012, 22:09

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

Postby ashutosh » 05 Jan 2012, 22:27

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];
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Postby A51Integrated » 05 Jan 2012, 22:41

The latest iPhone API is available here: 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

Postby ashutosh » 21 Feb 2012, 00:49

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!!
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: Connection to SFS2X RC3

Postby A51Integrated » 21 Feb 2012, 02:16

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

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 19 guests