Results 1 to 2 of 2
  1. #1

    Intermittent Connection Error - "Wrong Session ID" - .net standard client

    Hi,

    I am experiencing intermittent issues connecting to the lightstreamer server with the below code.

    I am using the Lighstreamer.DotNetStandard.Client v5.1.0. If I keep trying to connect I will eventually succeed but this can sometimes take 5 or 6 attempts.

    The closest post I could find relating to this mentioned setCookieHandlingRequired which isn't available in the .net standard from what I could see.

    Code:
    public void Connect()
            {
                //http://blog.lightstreamer.com/2020/02/new-lightstreamer-net-standard-client.html
    
    
                LightstreamerClient client = new LightstreamerClient(PushServerURL, Adapter);
                client.connectionDetails.User = Username;
                client.connectionDetails.Password = Password;
                
                MyClientListener cl = new MyClientListener();
                cl.ServerErrorReceived += Cl_ServerErrorReceived;
                cl.StatusUpdateReceived += Cl_StatusUpdateReceived;
    
    
                client.addListener(cl);
    
    
                Subscription sub = new Subscription("DISTINCT");
                sub.DataAdapter = DataAdapter;
                sub.ItemGroup = Group;
                sub.FieldSchema = Schema;
                sub.RequestedMaxFrequency = sub_max_freq + ""; //set to 1.0   
                QuestionConnectionListener ql = new QuestionConnectionListener();
                ql.QuestionUpdateReceived += Wrapper_QuestionUpdateReceived;
                
                sub.addListener(ql);
    
    
                client.connect();            
                client.subscribe(sub);
            }
    I see this in the output for each failure...

    ClientListener.onListenStart
    QuestionConnectionListener Instantiated...
    OnListenStart...
    ClientListener.onPropertyChange:sessionId
    SessionID:
    ClientListener.onPropertyChange:serverSocketName
    ClientListener.onPropertyChange:clientIp
    ClientListener.onPropertyChange:serverInstanceAddr ess
    ClientListener.onPropertyChange:realMaxBandwidth
    CONNECTING
    ClientListener.onStatusChange. Status=CONNECTING
    ClientListener.onPropertyChange:sessionId
    SessionID:S1d8f9cca8da82d06M381T0016607
    ClientListener.onPropertyChange:serverInstanceAddr ess
    CONNECTED:STREAM-SENSING
    ClientListener.onStatusChange. Status=CONNECTED:STREAM-SENSING
    ClientListener.onPropertyChange:serverSocketName
    ClientListener.onPropertyChange:clientIp
    ClientListener.onPropertyChange:realMaxBandwidth
    ClientListener.OnServerError. Error=Wrong session ID
    ClientListener.onPropertyChange:sessionId
    SessionID:
    ClientListener.onPropertyChange:serverSocketName
    ClientListener.onPropertyChange:clientIp
    ClientListener.onPropertyChange:serverInstanceAddr ess
    ClientListener.onPropertyChange:realMaxBandwidth
    DISCONNECTED
    ClientListener.onStatusChange. Status=DISCONNECTED
    ClientListener.OnServerError. Error=Wrong session ID


    On success I see...

    QuestionConnectionListener Instantiated...
    ClientListener.onListenStart
    OnListenStart...
    ClientListener.onPropertyChange:sessionId
    SessionID:
    ClientListener.onPropertyChange:serverSocketName
    ClientListener.onPropertyChange:clientIp
    ClientListener.onPropertyChange:serverInstanceAddr ess
    ClientListener.onPropertyChange:realMaxBandwidth
    CONNECTING
    ClientListener.onStatusChange. Status=CONNECTING
    ClientListener.onPropertyChange:sessionId
    SessionID:S90518d396f547b59M116T5849226
    ClientListener.onPropertyChange:serverInstanceAddr ess
    CONNECTED:STREAM-SENSING
    ClientListener.onStatusChange. Status=CONNECTED:STREAM-SENSING
    ClientListener.onPropertyChange:serverSocketName
    ClientListener.onPropertyChange:clientIp
    ClientListener.onPropertyChange:realMaxBandwidth
    ClientListener.onPropertyChange:keepaliveInterval
    ClientListener.onPropertyChange:realMaxBandwidth
    CONNECTED:HTTP-STREAMING
    ClientListener.onStatusChange. Status=CONNECTED:HTTP-STREAMING
    Start subscription.
    Real frequency: 1.0.
    End of Snapshot for .

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    668
    Hi mdb79,

    I can confirm that the setCookieHandlingRequired method is only present in the Web API, for other libraries such as .NET the management of cookies is automatic and does not require to be explicitly activated.
    So, please could you confirm that your client is targetting a cluster of Lightstreamer servers with a Load Blancer leveraging a cookie based Stickiness?

    Regards,
    Giuseppe

 

 

Similar Threads

  1. Replies: 1
    Last Post: July 12th, 2010, 11:05 AM

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 08:16 PM.