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.
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:serverInstanceAddress
ClientListener.onPropertyChange:realMaxBandwidth
CONNECTING
ClientListener.onStatusChange. Status=CONNECTING
ClientListener.onPropertyChange:sessionId
SessionID:S1d8f9cca8da82d06M381T0016607
ClientListener.onPropertyChange:serverInstanceAddress
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:serverInstanceAddress
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:serverInstanceAddress
ClientListener.onPropertyChange:realMaxBandwidth
CONNECTING
ClientListener.onStatusChange. Status=CONNECTING
ClientListener.onPropertyChange:sessionId
SessionID:S90518d396f547b59M116T5849226
ClientListener.onPropertyChange:serverInstanceAddress
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 .