Results 1 to 10 of 10
  1. #1

    Connection timed out on empty credentials on iOS [iOS]

    Hello,

    I am using empty username and password while trying to connect to my server (which works with LS Javascript SDK), but instead I get didReceiveConnectionFailure with the error: Connection timed out.

    I am using LS iOS SDK v.1.2.6 (LS 5.1.2.).

    Can you please advise?

    Thanks,
    Nathan

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    93
    Hello Anatoly,

    which edition of the server are you using? If it is a Moderato (free), consider that the iOS client is not supported on this edition. To use the iOS client you need one of Allegro, Presto or Vivace.

    If you are not using the Moderato edition, please add the following lines in your App delegate to enable some logging:

    Code:
    [LSLog enableSourceType:LOG_SRC_CLIENT];
    [LSLog enableSourceType:LOG_SRC_STATE_MACHINE];
    [LSLog enableSourceType:LOG_SRC_SESSION];
    Send us the resulting log, with it we will be able to diagnose the problem.
    Best regards,

    Gianluca

  3. #3
    Hi,

    Not sure about the version, but it does work with non-empty credentials. The only issue is when I set nil or empty strings to username and password in the initializer of LSConnectionInfo.

    Here is the log as you requested:

    2015-07-06 11:21:28.231 Hoops[2257:201376] <Thread 0x17407b800> LSClient 0x17414e860: opening connection...
    2015-07-06 11:21:28.235 Hoops[2257:201422] <Thread 0x1740eae00> LSConnectionStateMachine 0x174283d40: handling event Conn in state None...
    2015-07-06 11:21:28.301 Hoops[2257:201424] <Thread 0x1700ec180> iSLSession 0x1700ec380: dispatching connection to http://54.76.5.24/lightstreamer/create_session.txt
    2015-07-06 11:21:28.305 Hoops[2257:201424] <Thread 0x1700ec180> iSLSession 0x1700ec380: connection to http://54.76.5.24/lightstreamer/create_session.txt dispatched
    2015-07-06 11:21:28.865 Hoops[2257:201427] <Thread 0x1700b9200> iSLSession 0x1700ec380: connection received response: <NSHTTPURLResponse: 0x174221d20> { URL: http://54.76.5.24/lightstreamer/create_session.txt } { status code: 200, headers {
    "Cache-Control" = "no-store,no-cache";
    "Content-Length" = 16;
    "Content-Type" = "text/enriched; charset=iso-8859-1";
    Date = "Mon, 6 Jul 2015 08:23:16 GMT";
    Expires = "Thu, 1 Jan 1970 00:00:00 GMT";
    Pragma = "no-cache";
    Server = "Lightstreamer/5.1.2 build 1623.14 (Lightstreamer Push Server - www.lightstreamer.com) Vivace edition";
    } }
    2015-07-06 11:21:28.867 Hoops[2257:201427] <Thread 0x1700b9200> iSLSession 0x1700ec380: connection finished
    2015-07-06 11:21:33.241 Hoops[2257:201422] <Thread 0x1740eae00> LSConnectionStateMachine 0x174283d40: handling event Tout in state Wait...
    2015-07-06 11:21:33.244 Hoops[2257:201424] <Thread 0x1700ec180> iSLSession 0x1740ede80: dispatching connection to http://54.76.5.24/lightstreamer/create_session.txt
    2015-07-06 11:21:33.245 Hoops[2257:201424] <Thread 0x1700ec180> iSLSession 0x1740ede80: connection to http://54.76.5.24/lightstreamer/create_session.txt dispatched
    2015-07-06 11:21:33.246 Hoops[2257:201424] <Thread 0x1700ec180> LSConnectionStateMachine 0x174283d40: cleaning up session...
    2015-07-06 11:21:33.249 Hoops[2257:201424] <Thread 0x1700ec180> LSConnectionStateMachine 0x174283d40: session cleaned up
    2015-07-06 11:21:44.379 Hoops[2257:201442] Connection timed out

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    93
    You may be experiencing an old bug where certain server errors ended up as time outs (with the underlying error being an authentication failure). You can download an updated version of the 1.2.x client from this address: www.lightstreamer.com/temp/Lightstreamer client for iOS v. 1.2.7 build 74.49.zip. Once updated, the client should properly return the error.

    Server version 5.x (and corresponding iOS client 1.2.x) are now superseded by version 6.x (and corresponding iOS client 1.4.x). Consider upgrading.
    Best regards,

    Gianluca

  5. #5
    Thanks!

    Updated the version you sent, and now I get didReceiveServerFailure with the following error: Server exception (reason: 'Lightstreamer error received: 0 null')

  6. #6
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    93
    This is probably your metadata adapter refusing the authentication and returning an unspecified error. Remember that CreditsException accepts only negative numbers as error codes, positive numbers are truncated to 0 (they are reserver for use by Lightstreamer).

    If you don't have a logging system for you metadata adapter, you may set the logger LightstreamerLogger.connections.http at DEBUG level to have some clues. But beware: it's quite verbose, avoid doing it on a production server under load.

  7. #7
    What is weird, is that the same works when doing the same with Javascript SDK.
    In JS, I simply do not pass the username and the password, but in iOS I pass them as nil, because there is only one initializer to LSConnectionInfo.

    If it were something wrong with the Server configuration, I would get some error with JS as well, isn't it?

  8. #8
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    93
    If you can't discern the problem by taking a look at the log by yourself, proceed as follows:

    - keep LightstreamerLogger.connections.http at DEBUG level;
    - grab a server-side log while connecting with the JavaScript client (with user and password null);
    - grab a server-side log while connecting with the iOS client (again with user and password nil, use the updated version 1.2.7);
    - send us the two logs at support@lightstreamer.com.

    We will examine the log and try to sort out this weird behavior for you.
    Best regards,

    Gianluca

  9. #9
    Hi,

    I'm developing server side for Anatoly's iOS client, and our Metadata adapter is receiving empty string for user parameter when iOS sends nil (it receives char $, which is supposed to be encoding for empty string). On the other hand, javascript client correctly sends null (char #) when user is not set on connectionDetails.

    We've adjusted our Metadata adapter to treat $ as null strings, solving our problem, but I believe there's a bug in iOS client library that causes this.

    BR,
    Dejan

  10. #10
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    93
    Hello Dejan,

    you may be right, it seems there's a misalignment between Javascript and iOS clients, where the Javascript client omits the user for a null parameter, while the iOS client sends an empty user for a nil parameter. Thanks for reporting it.

    We will fix this bug in an upcoming version. As suggested above, consider upgrading to Server 6.x, as this fix may not be released for older client libraries.

    Best regards,

    Gianluca

 

 

Similar Threads

  1. Replies: 7
    Last Post: February 5th, 2015, 12:15 PM
  2. GroupListDescriptor Item names cannot be empty
    By vaduganathan in forum Client APIs
    Replies: 3
    Last Post: April 27th, 2010, 03:00 PM
  3. Unexpected empty selected list
    By shreyaspurohit in forum Adapter APIs
    Replies: 4
    Last Post: April 14th, 2009, 11:38 AM
  4. Item Names cannot be empty
    By d.verzolini in forum Client APIs
    Replies: 2
    Last Post: September 22nd, 2008, 11:34 AM
  5. Timed
    By skidrow406 in forum Adapter APIs
    Replies: 4
    Last Post: April 15th, 2008, 12:54 PM

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 07:50 PM.