-
November 17th, 2014, 07:14 PM
#1
Lighstreamer connection exception [iOS]
Hello community,
I'm experiencing this kind of exception
2014-11-17 19:06:23.088 XXX[7431:607] Connecting to Lightstreamer...
2014-11-17 19:06:23.089 XXX[7431:972b] [LIGHTSTREAMER] Connection closed
2014-11-17 19:06:23.092 XXX[7431:3b03] *** Terminating app due to uncaught exception 'Lightstreamer connection exception', reason: 'Connection interrupted'
*** First throw call stack:
(
0 CoreFoundation 0x026ba1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x01ab08e5 objc_exception_throw + 44
2 XXX 0x00139620 -[LSClient openConnectionWithInfo:delegate:] + 1011
3 XXX 0x000663f4 __54-[XXXNavigatorViewController connectToLightstreamer]_block_invoke + 68
4 libdispatch.dylib 0x036f37b8 _dispatch_call_block_and_release + 15
5 libdispatch.dylib 0x037084d0 _dispatch_client_callout + 14
6 libdispatch.dylib 0x036f6eb7 _dispatch_root_queue_drain + 291
7 libdispatch.dylib 0x036f7127 _dispatch_worker_thread2 + 39
8 libsystem_pthread.dylib 0x03a332e3 _pthread_wqthread + 801
9 libsystem_pthread.dylib 0x03a30eea start_wqthread + 30
)
libc++abi.dylib: terminating with uncaught exception of type LSPushConnectionException
The exception happens exactly while I'm doing a call to my back end web services using AFNetworking. IT's a systematic crash, what can be the cause?
-
November 18th, 2014, 09:46 AM
#2
Hello,
the exception you see may be caused by a closeConnection called while the client is still connecting. It's not an error condition, you may avoid crashing by surrounding the openConnection call with a @try-@catch block, e.g.:
@try {
[client openConnectionWithInfo:info delegate:self];
// Connection established
} @catch (LSPushConnectionException *e) {
// Connection failed
}
Hope this helps. Don't hesitate to ask if your need more infos.
Best regards,
Gianluca
-
November 19th, 2014, 08:53 AM
#3
Thanx Gianluca, it seems to work so far.
Best regards,
Andrea
-
November 19th, 2014, 01:11 PM
#4

Originally Posted by
DrAma
Thanx Gianluca, it seems to work so far.
Best regards,
Andrea
Even in the try-catch block, the app still crashes, with the same exception.
If I comment the light streamer apart everything works fine.
Probably this not the only part to put in a try catch block.
Last edited by DrAma; November 19th, 2014 at 04:15 PM.
-
November 20th, 2014, 10:02 AM
#5
Hello,
the library documentation specifies, for each API call, the exceptions it may throw. LSPushConnectionException may be raised in a number of situations, in particular when an API call is made that requires a connection (e.g. subscriptions, send messages, etc.) and there is no connection available. Check the documentation, and don't hesitate to ask if you have any doubt.
Best regards,
Gianluca
-
November 22nd, 2014, 02:05 PM
#6
Thank you Gianluca, we arranged wrapping almost every call to lighstreamer around a try-catch
-
November 27th, 2014, 06:48 PM
#7
Since I'm using it for a while I can say that this library throws a lot of exception, that make really difficult to use it.
I wrapped almost avery call to the light streamer into a try catch, it doesn't feel good.
My suggestion is to change that behavior converting inside exceptions into NSError objects as most COCOA libraries does.
Best regards,
Andrea
-
November 28th, 2014, 12:40 PM
#8
Hi Andrea,
Thanks for your suggestions. We are taking them in serious consideration. We will ponder on this topic for a couple weeks. We will let you know any news on this.
Cheers,
Alessandro
-
December 11th, 2014, 01:23 PM
#9
Similar Threads
-
By Dmitry Sazanovich in forum Client SDKs
Replies: 21
Last Post: May 21st, 2016, 09:28 AM
-
By Anatoly Gurfinkel in forum Client SDKs
Replies: 9
Last Post: July 6th, 2015, 05:24 PM
-
By benthemos in forum Client SDKs
Replies: 4
Last Post: February 27th, 2015, 07:58 AM
-
By Andrea in forum Adapter SDKs
Replies: 3
Last Post: April 30th, 2012, 05:39 PM
-
By forexinvestor in forum Adapter SDKs
Replies: 1
Last Post: December 23rd, 2008, 09:55 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 10:19 PM.
Bookmarks