Problem when sending byte array
Hi, I'm still having issues after using the new release.
I'm trying to send over a byte array of an image from Flash over SFS to iOS to display.
I've tested it with a Flash client and it correctly renders the image. It crashes in iOS.
I'm trying to send over a byte array of an image from Flash over SFS to iOS to display.
I've tested it with a Flash client and it correctly renders the image. It crashes in iOS.
Code: Select all
[Session started at 2011-02-09 21:09:46 +0800.]
2011-02-09 21:09:51.926 SFSwebcam[12021:207] connection success
2011-02-09 21:09:51.943 SFSwebcam[12021:207] ROOM JOINED
2011-02-09 21:09:51.958 SFSwebcam[12021:207] *** Terminating app due to uncaught exception 'SFSCodecException', reason: 'Invalid SFSDataType. Expected: 18, found: 120'
*** Call stack at first throw:
(
0 CoreFoundation 0x01142be9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x012975c2 objc_exception_throw + 47
2 SFSwebcam 0x0000e1b7 -[DefaultSFSDataSerializer decodeSFSObject:] + 202
3 SFSwebcam 0x0001002e -[DefaultSFSDataSerializer binary2object:] + 222
4 SFSwebcam 0x00024832 +[SFSObject newFromBinaryData:] + 72
5 SFSwebcam 0x00026bdd -[SFSProtocolCodec onPacketRead:] + 50
6 SFSwebcam 0x000232f7 -[SFSIOHandler handlePacketData:] + 781
7 SFSwebcam 0x0002406b -[SFSIOHandler onDataRead:] + 558
8 SFSwebcam 0x0000668f -[BitSwarmClient stream:handleEvent:] + 1753
9 CoreFoundation 0x0111e1d2 _inputStreamCallbackFunc + 82
10 CoreFoundation 0x010f2093 _signalEventSync + 99
11 CoreFoundation 0x010f1ffe _cfstream_shared_signalEventSync + 334
12 CoreFoundation 0x0112401f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
13 CoreFoundation 0x0108228b __CFRunLoopDoSources0 + 571
14 CoreFoundation 0x01081786 __CFRunLoopRun + 470
15 CoreFoundation 0x01081240 CFRunLoopRunSpecific + 208
16 CoreFoundation 0x01081161 CFRunLoopRunInMode + 97
17 GraphicsServices 0x0178f268 GSEventRunModal + 217
18 GraphicsServices 0x0178f32d GSEventRun + 115
19 UIKit 0x0049642e UIApplicationMain + 1160
20 SFSwebcam 0x000028bc main + 102
21 SFSwebcam 0x0000284d start + 53
)
terminate called after throwing an instance of 'SFSCodecException'
Sure, here it is: http://dl.dropbox.com/u/276096/labs_savewebcam.zip
I've given the link to an experiment I was trying out: To send a series of images to the iPhone. This one is an initial test of sending bytearray between 2 flash instances.
I've given the link to an experiment I was trying out: To send a series of images to the iPhone. This one is an initial test of sending bytearray between 2 flash instances.
- cemuzunlar
- Posts: 47
- Joined: 26 Dec 2008, 00:45
- Contact:
Hi geraldyeo,
We tested 100 K, 1 MB, 4 MB, 5 MB, 9 MB image files send from iPhone to Server, Server to iPhone, both with simulator and with device. We displayed the images send from the Server in he iPhone; Calculated the MD5 both on Server and on iPhone. No problem or crash happened during those tests.
Please make sure that
You are using the latest fixed API (http://smartfoxserver.com/2X/quickUpdat ... 010211.zip)
If it is the correct API, lines 82:85 should be:
if you are the latest API but still having problems, please send me the:
1) Your server source code
2) Your iPhone XCode project
3) Used test files etc.
4) Your SFS2X version.
Thanks,
We tested 100 K, 1 MB, 4 MB, 5 MB, 9 MB image files send from iPhone to Server, Server to iPhone, both with simulator and with device. We displayed the images send from the Server in he iPhone; Calculated the MD5 both on Server and on iPhone. No problem or crash happened during those tests.
Please make sure that
You are using the latest fixed API (http://smartfoxserver.com/2X/quickUpdat ... 010211.zip)
If it is the correct API, lines 82:85 should be:
Code: Select all
//handle Compression
if (_pendingPacket.header.compressed) {
_pendingPacket.buffer =
[NSMutableData dataWithData:[_pendingPacket.buffer zlibInflate]];
}
if you are the latest API but still having problems, please send me the:
1) Your server source code
2) Your iPhone XCode project
3) Used test files etc.
4) Your SFS2X version.
Thanks,
Cem Uzunlar
Infosfer Game and Visualization Technologies
http://www.infosfer.com
contact@infosfer.com
Infosfer Game and Visualization Technologies
http://www.infosfer.com
contact@infosfer.com
Code: Select all
3) No test files, using webcam stream from Flash client
I don't know if it makes much sense. SFS is not meant for streaming, but anyways in theory it should work, I agree although the final result might be not so good.
Out of curiosity... do you decode the Flash video on the iphone at runtime?
Hi Lapo,
I know SFS is not meant for streaming, but I want to do a proof of concept on the possibilities. I'm aware that the quality may not be good.
Yes, I'm thinking of decoding the images at runtime on the iPhone. However, in the source files i sent i've not reach that stage yet, because iPhone sim is crashing on me.
I know SFS is not meant for streaming, but I want to do a proof of concept on the possibilities. I'm aware that the quality may not be good.
Yes, I'm thinking of decoding the images at runtime on the iPhone. However, in the source files i sent i've not reach that stage yet, because iPhone sim is crashing on me.
- cemuzunlar
- Posts: 47
- Joined: 26 Dec 2008, 00:45
- Contact:
- cemuzunlar
- Posts: 47
- Joined: 26 Dec 2008, 00:45
- Contact:
We checked your sources. We are pretty sure that you are somehow using the old API.
Because, there is no -lz flag in your Other Linked Flags, and if you were using the new API, you couldn't compile your project successfully without adding it.
So please search and remove all files related to the old SFS2X iPhone API, then download and install the new SFS2X iPhone API and make sure that your project is actually using those files.
Because, there is no -lz flag in your Other Linked Flags, and if you were using the new API, you couldn't compile your project successfully without adding it.
So please search and remove all files related to the old SFS2X iPhone API, then download and install the new SFS2X iPhone API and make sure that your project is actually using those files.
Hi cemuzunlar,
I've removed and re-added the SFS2x and TouchXML folder to my project, and added -lxml2 -lz to Other Linker Flags.
It seems that I need to build with Release, because it doesn't crash. Maybe that's what's needed?
Also, in my viewcontroller I've the <ISFSEvents> so that I can capture the objectMessage events " - (void)onObjectMessage:(SFSEvent *)evt", but it isn't triggering. I couldn't find an example in your help documents, so if you could let me know if there is one or if I did something wrongly?
Thanks!
I've removed and re-added the SFS2x and TouchXML folder to my project, and added -lxml2 -lz to Other Linker Flags.
It seems that I need to build with Release, because it doesn't crash. Maybe that's what's needed?
Also, in my viewcontroller I've the <ISFSEvents> so that I can capture the objectMessage events " - (void)onObjectMessage:(SFSEvent *)evt", but it isn't triggering. I couldn't find an example in your help documents, so if you could let me know if there is one or if I did something wrongly?
Thanks!
- cemuzunlar
- Posts: 47
- Joined: 26 Dec 2008, 00:45
- Contact:
Who is online
Users browsing this forum: No registered users and 95 guests