Hi,
I'm realizing a service with SmartFoxServer 2X, my server is ok, my extension too and my Flash client to, but not my iPhone client !
All connections are okay, but not a return of my extension ! this extension works with my Flash Client, but not with my iPhone Client. I have got an error when my app has a result :
*** Terminating app due to uncaught exception 'SFSCodecException', reason: 'Invalid SFSDataType. Expected: 18, found: 120'
*** Call stack at first throw:
(
0 CoreFoundation 0x0155fbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x016b45c2 objc_exception_throw + 47
2 LionCereales 0x0006d983 -[DefaultSFSDataSerializer decodeSFSObject:] + 202
3 LionCereales 0x0006f7fa -[DefaultSFSDataSerializer binary2object:] + 222
4 LionCereales 0x0005f1ba +[SFSObject newFromBinaryData:] + 72
5 LionCereales 0x000597ed -[SFSProtocolCodec onPacketRead:] + 50
6 LionCereales 0x00058051 -[SFSIOHandler handlePacketData:] + 781
7 LionCereales 0x00058dc5 -[SFSIOHandler onDataRead:] + 558
8 LionCereales 0x0004b44b -[BitSwarmClient stream:handleEvent:] + 1753
9 CoreFoundation 0x0153b1d2 _inputStreamCallbackFunc + 82
With this trace and the XCode debugger, i found where is a problem : in the function -(id <ISFSObject>)decodeSFSObject:(Data *)buffer.
In this function, the exception has thrown here :
id <ISFSObject> sfsObject = [SFSObject newInstance];
int8_t headerByte = [buffer readByte];
if (headerByte != SFSDataType_SFS_OBJECT) {
@throw [SFSCodecException exceptionWithReason:[NSString stringWithFormat:@"Invalid SFSDataType. Expected: %d, found: %d", SFSDataType_SFS_OBJECT, headerByte]];
}
Like my packet is not an SFSDataType_SFS_OBJECT !
But it's the same packet return in my Flash Client ! but why my iPhone Client crash, and not my Flash Client ???
Can you help me ?
Thank you
Guillaume
[INFSmartFoxiPhoneClientAPI_2X] Crash on decodeSFSObject
-
- Posts: 2
- Joined: 15 Feb 2011, 07:33
-
- Posts: 2
- Joined: 15 Feb 2011, 07:33
I have got a similar problem in my iPhone app. Unfortunately, I am not sure which library do you refer by
But the crash happens only when I dynamically create rooms with custom variables. These rooms are created every time a user joins the lobby room (which is created statically). Here is the server extension code which does the work.
Could anyone help me with my problem?
I am using the client API library, which has been installed by default with the SFS2X version for Mac OS 10.5 +.the last library by Lapo...
But the crash happens only when I dynamically create rooms with custom variables. These rooms are created every time a user joins the lobby room (which is created statically). Here is the server extension code which does the work.
Code: Select all
List<RoomVariable> vars = new ArrayList<RoomVariable>();
vars.add(new SFSRoomVariable("blind", 10, false, false, true));
vars.add(new SFSRoomVariable("speed", 15, false, false, true));
vars.add(new SFSRoomVariable("vip", false, false, false, true));
CreateRoomSettings crs = new CreateRoomSettings();
crs.setMaxVariablesAllowed(20);
crs.setName("PokerRoom" + index++);
crs.setMaxUsers(9);
crs.setMaxSpectators(99);
crs.setGame(true);
crs.setRoomVariables(vars);
getApi().createRoom(getParentExtension().getParentZone(), crs, null);
Could anyone help me with my problem?
I did some experiments, and here is what I have found. The problem is not in te dynamically created rooms. Even if I create the statically (using the admin tool), then the crash happens if the number of rooms in a zone is >= 10. But I have set the "maximum rooms for zone" to be 500. Is it a limitation of the free version?
I've finally figured out the problem. If there were too many rooms/variables, then the packet size exceeded the protocol compression threshold. So, I was receiving compressed data on the iPhone side. Strangely, the client API could not figure it out and expected the incoming data to be plain text.
For now, I have increased the protocol compression threshold to continue my work. But I can not understand what should I do to enable handling of compressed data on the iPhone side? Are there some special configuration tags that should be put in the configuration XML file?
For now, I have increased the protocol compression threshold to continue my work. But I can not understand what should I do to enable handling of compressed data on the iPhone side? Are there some special configuration tags that should be put in the configuration XML file?
Same Issue
Hey I have the same issue, which library are you talking about? (The one you installed?)
Same issue here with compression. I have a separate thread about it and the only solution is to basically disable the compression with a huge threshold (1GB).
My server is RC3
Latest iPhone API from Sept 9th 2011
First there is coding problem when packet is compressed to go to server. When I cleared the issue, the server throws error that can not decompress the packet. If you provide some details on the compression mechanism and what exactly the server expects I can help you with the code.
My server is RC3
Latest iPhone API from Sept 9th 2011
First there is coding problem when packet is compressed to go to server. When I cleared the issue, the server throws error that can not decompress the packet. If you provide some details on the compression mechanism and what exactly the server expects I can help you with the code.
@mmilen
Bax is looking at the issue, I have sent him my crash log last week and he is looking into it.
Hope it's fixed soon..
Hope it's fixed soon..
Return to “SFS2X iPhone / iPad / OSX API”
Who is online
Users browsing this forum: No registered users and 33 guests