Results 1 to 7 of 7
  1. #1

    disable auto reconnecting

    Hi,
    I need to avoid auto reconnecting with :
    Code:
    - (void) clientConnection:(LSClient *)client didReceiveServerFailure:(LSPushServerException *)failure
    Code:
    {
         [_clientperformSelectorInBackground:@selector(closeConnection) withObject:nil];
    }
    

    but i recent error on :
    Code:
    [_clientopenConnectionWithInfo:connectioninfo delegate:self];
    Thread 8: signal SIGABRT

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    90
    Hello Ebrahim,

    I added this code to the sample I've provided you through support, and it works without problems. I can send the updated code to you again via support.

    My advice is to check for memory management issues in your code, e.g.: check if you retained correctly the objects you are using, like the connectionInfo.

    Hope this helps.
    Best regards,

    Gianluca

  3. #3
    Hello Gianluca,
    My Code is :
    - (void)connectWithLightStreamer
    {

    fieldNames = [NSArrayarrayWithObjects:LIGHTSTREAMER_FIELDNAMES, nil];
    [selfperformSelectorInBackground:@selector(connectInBackground) withObject:nil];

    }
    - (void) connectInBackground
    {
    _client = [[LSClientalloc] init];
    LSConnectionInfo *connectioninfo = [LSConnectionInfo connectionInfoWithPushServerURL:LIGHTSTREAMER_CONNECITON_ADDRESS pushServerControlURL:nil user:@"username" password:@"password" adapter:LIGHTSTREAMER_CONNECITON_ADAPTER];
    [_clientopenConnectionWithInfo:connectioninfo delegate:self];
    }
    - (void) clientConnectionLSClient *)client didReceiveServerFailureLSPushServerException *)failure {


    [_clientperformSelectorInBackground:@selector(closeConnection) withObject:nil];

    }

    but i receive error : Thread 8:signal SIGABRT

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    90
    Hello Ebrahim,

    to trace this problem I will need full logs and possibly a crash dump. You should add the following lines to your application:didFinishLaunchingWithOptions: delegate:

    [LSLogenableSourceType:LOG_SRC_CLIENT];
    [LSLogenableSourceType:LOG_SRC_SESSION];
    [LSLogenableSourceType:LOG_SRC_STATE_MACHINE];

    Then run your app until you get the crash, save the crash dump and contact support sending both the crash dump and the logs the app has produced.

    Thanks.
    Best regards,

    Gianluca

  5. #5

    Lsog

    Quote Originally Posted by gianluca.bertani View Post
    Hello Ebrahim,

    to trace this problem I will need full logs and possibly a crash dump. You should add the following lines to your application:didFinishLaunchingWithOptions: delegate:

    [LSLogenableSourceType:LOG_SRC_CLIENT];
    [LSLogenableSourceType:LOG_SRC_SESSION];
    [LSLogenableSourceType:LOG_SRC_STATE_MACHINE];

    Then run your app until you get the crash, save the crash dump and contact support sending both the crash dump and the logs the app has produced.

    Thanks.
    Best regards,

    Gianluca
    Hi Gianluca,
    2013-05-28 17:34:03.723 M-Trader[5095:3c07] <Thread 0x6d264e0> LSClient 0x7c5cad0: opening connection...
    2013-05-28 17:34:03.724 M-Trader[5095:4303] <Thread 0x7b15c60> LSConnectionStateMachine 0x7b15ae0: thread started
    2013-05-28 17:34:03.725 M-Trader[5095:4303] <Thread 0x7b15c60> LSConnectionStateMachine 0x7b15ae0: handling event 1001 in state 0...
    2013-05-28 17:34:03.726 M-Trader[5095:4d03] <Thread 0x6d389a0> iSLSession 0x6d376d0: creating connection to http://{myURL}
    2013-05-28 17:34:03.728 M-Trader[5095:4d03] <Thread 0x6d389a0> iSLSession 0x6d376d0: connection started to http://{myURL}
    2013-05-28 17:34:04.329 M-Trader[5095:4d03] <Thread 0x6d389a0> iSLSession 0x6d376d0: connection failed with error: Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo=0x7bb50d0 {NSErrorFailingURLStringKey=http://{myURL}/lightstreamer/create_session.txt, NSErrorFailingURLKey=http://{myURL}/lightstreamer/create_session.txt, NSLocalizedDescription=Could not connect to the server., NSUnderlyingError=0x7b1e610 "Could not connect to the server."}
    2013-05-28 17:34:04.331 M-Trader[5095:4303] <Thread 0x7b15c60> LSConnectionStateMachine 0x7b15ae0: handling event 3003 in state 101...
    2013-05-28 17:34:04.331 M-Trader[5095:4d03] <Thread 0x6d389a0> iSLSession 0x6d376d0: connection stopped to http://{myURL}
    2013-05-28 17:34:04.332 M-Trader[5095:6003] <Thread 0x785b270> LSClient 0x7c5cad0: interrupting connection open...
    2013-05-28 17:34:04.332 M-Trader[5095:4303] <Thread 0x7b15c60> LSConnectionStateMachine 0x7b15ae0: handling event 1103 in state 105...
    2013-05-28 17:34:04.333 M-Trader[5095:4d07] <Thread 0x7b0f630> LSConnectionStateMachine 0x7b15ae0: cleaning up session...
    2013-05-28 17:34:04.333 M-Trader[5095:3c07] *** Terminating app due to uncaught exception 'Lightstreamer connection exception', reason: 'Stream error occurred (reason: 'Error code -1004: Could not connect to the server.')'
    *** First throw call stack:
    (0x1a8d052 0x187cd0a 0x136b8e 0xa1a31 0x10274e6 0x1027457 0x9898d557 0x98977cee)
    terminate called throwing an exception2013-05-28 17:34:04.333 M-Trader[5095:6003] <Thread 0x785b270> LSClient 0x7c5cad0: connection open interrupted
    2013-05-28 17:34:06.911 M-Trader[5095:4d07] <Thread 0x7b0f630> LSConnectionStateMachine 0x7b15ae0: session cleaned up


  6. #6
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    90
    Hello Ebrahim,

    it seems what you are experiencing is not a crash due to some sort of bug, but simply an uncaught exception. As stated in the LS client library documentation set, openConnectionWithInfo may raise two kind of exceptions (LSPushServerException and LSPushConnectionException) and thus you need a try/catch block, such as:

    @try {
    [_client openConnectionWithInfo:connectioninfo delegate:self];

    } @catch (NSException *e) {
    NSLog(@"Can't connect due to exception: %@", e);
    }

    Best regards,

    Gianluca

  7. #7
    Hello Gianluca,
    Thank you my problem was solved

 

 

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:18 PM.