Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

TCPSockets

Hi,

I am trying to use a READ_WRITE_MORE socket using the mobile SDK and I can write over the socket fine but if the server writes anything my app throws the below error, I have attemtped to connect to a normal SMTP server on port 25 as a test and my app bombs out on the welcome message.

Many thanks in advance

[ERROR] The application has crashed with an unhandled exception. Stack trace:
0 CoreFoundation 0x035898fc exceptionPreprocess + 156
1 libobjc.A.dylib 0x036d75de objc_exception_throw + 47
2 CoreFoundation 0x0358b23e +[NSObject(NSObject) init] + 174
3 SpectrumGen 0x00103132 -[TiNetworkTCPSocketProxy readFromStream:] + 119
4 SpectrumGen 0x00100d65 _Z14handleReadDataP14
CFReadStreammPv + 237
5 CoreFoundation 0x03538a23 _signalEventSync + 99
6 CoreFoundation 0x035392ee _cfstream_solo_signalEventSync + 126
7 CoreFoundation 0x03538799 _CFStreamSignalEvent + 457
8 CoreFoundation 0x03539237 CFReadStreamSignalEvent + 39
9 CFNetwork 0x02992d99 _ZN12SocketStream40dispatchSignalFromSocketCallbackUnlockedEP24SocketStreamSignalHolder + 45
10 CFNetwork 0x028ee9b1 _ZN12SocketStream14socketCallbackEP10CFSocketmPK8CFDataPKv + 277
11 CFNetwork 0x028ee87f _ZN12SocketStream22_SocketCallBack_streamEP10CFSocketmPK8CFDataPKvPv + 117
12 CoreFoundation 0x03503690 CFSocketDoCallback + 608
13 CoreFoundation 0x0350316a
CFSocketPerformV0 + 138
14 CoreFoundation 0x0356ad7f CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 15
15 CoreFoundation 0x034c92cb CFRunLoopDoSources0 + 571
16 CoreFoundation 0x034c87c6
CFRunLoopRun + 470
17 CoreFoundation 0x034c8280 CFRunLoopRunSpecific + 208
18 CoreFoundation 0x034c81a1 CFRunLoopRunInMode + 97
19 GraphicsServices 0x03a642c8 GSEventRunModal + 217
20 GraphicsServices 0x03a6438d GSEventRun + 115
21 UIKit 0x0076ab58 UIApplicationMain + 1160
22 SpectrumGen 0x00004033 main + 360
23 SpectrumGen 0x00003011 start + 53
24 ??? 0x00000001 0x0 + 1
2010-07-22 02:55:54.432 SpectrumGen[7885:207] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' +[NSMutableData<0x35eb30c> init]: cannot init a class object.'
* Call stack at first throw:
(
0 CoreFoundation 0x03589919 exceptionPreprocess + 185
1 libobjc.A.dylib 0x036d75de objc_exception_throw + 47
2 CoreFoundation 0x0358b23e +[NSObject(NSObject) init] + 174
3 SpectrumGen 0x00103132 -[TiNetworkTCPSocketProxy readFromStream:] + 119
4 SpectrumGen 0x00100d65 _Z14handleReadDataP14
CFReadStreammPv + 237
5 CoreFoundation 0x03538a23 _signalEventSync + 99
6 CoreFoundation 0x035392ee _cfstream_solo_signalEventSync + 126
7 CoreFoundation 0x03538799 _CFStreamSignalEvent + 457
8 CoreFoundation 0x03539237 CFReadStreamSignalEvent + 39
9 CFNetwork 0x02992d99 _ZN12SocketStream40dispatchSignalFromSocketCallbackUnlockedEP24SocketStreamSignalHolder + 45
10 CFNetwork 0x028ee9b1 _ZN12SocketStream14socketCallbackEP10CFSocketmPK8CFDataPKv + 277
11 CFNetwork 0x028ee87f _ZN12SocketStream22_SocketCallBack_streamEP10CFSocketmPK8CFDataPKvPv + 117
12 CoreFoundation 0x03503690 CFSocketDoCallback + 608
13 CoreFoundation 0x0350316a
CFSocketPerformV0 + 138
14 CoreFoundation 0x0356ad7f CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 15
15 CoreFoundation 0x034c92cb CFRunLoopDoSources0 + 571
16 CoreFoundation 0x034c87c6
CFRunLoopRun + 470
17 CoreFoundation 0x034c8280 CFRunLoopRunSpecific + 208
18 CoreFoundation 0x034c81a1 CFRunLoopRunInMode + 97
19 GraphicsServices 0x03a642c8 GSEventRunModal + 217
20 GraphicsServices 0x03a6438d GSEventRun + 115
21 UIKit 0x0076ab58 UIApplicationMain + 1160
22 SpectrumGen 0x00004033 main + 360
23 SpectrumGen 0x00003011 start + 53
24 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
[INFO] Application has exited from Simulator

— asked July 22nd 2010 by Brett Miller
  • mobile
  • read
  • tcp
0 Comments

0 Answers

The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.