Results 1 to 9 of 9
  1. #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?

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    102
    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

  3. #3
    Thanx Gianluca, it seems to work so far.
    Best regards,
    Andrea

  4. #4
    Quote Originally Posted by DrAma View Post
    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.

  5. #5
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    102
    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

  6. #6
    Thank you Gianluca, we arranged wrapping almost every call to lighstreamer around a try-catch

  7. #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

  8. #8
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    521
    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

  9. #9
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    521

 

 

Similar Threads

  1. Exception [iOS]
    By Dmitry Sazanovich in forum Client SDKs
    Replies: 21
    Last Post: May 21st, 2016, 09:28 AM
  2. Connection timed out on empty credentials on iOS [iOS]
    By Anatoly Gurfinkel in forum Client SDKs
    Replies: 9
    Last Post: July 6th, 2015, 05:24 PM
  3. Replies: 4
    Last Post: February 27th, 2015, 07:58 AM
  4. Lighstreamer stress testing
    By Andrea in forum Adapter SDKs
    Replies: 3
    Last Post: April 30th, 2012, 05:39 PM
  5. Pull data from txt file to lighstreamer (NEWBIE)
    By forexinvestor in forum Adapter SDKs
    Replies: 1
    Last Post: December 23rd, 2008, 09:55 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 05:41 AM.