-
October 25th, 2023, 06:11 AM
#1
Invalid Handshake over WS
Hello, I have been running the below c# code snippet with the .net client SDK (version 5.1.0) against our Lightstreamer server version 7.2.2 and I kept getting invalid handshake and the connection kept switching to HTTP.
I tried ForcedTransport = "WS" and "WS-Streaming" as well but still no luck.
I tried the quickstart example on here, https://sdk.lightstreamer.com/ls-dot...les/intro.html and it worked fine with me.
Also I have a Java version (similar to the C# code below) and it works fine as well. It connects and I get status WS-Streaming back successfully. Somehow I can't make it work with the following though. Any idea what could be the reason?
using com.lightstreamer.client;
using Lightstreamer.DotNet.Logging.Log;
namespace ConsoleApp;
internal class Program
{
public static void Main()
{
LightstreamerClient.setLoggerProvider(new Log4NetLoggerProviderWrapper());
var client = new LightstreamerClient("https://myurl", "myAdapterSet")
{
connectionDetails =
{
User = "user",
Password = "token"
}
};
}
}
Log;
Session ID value changed to
Server Socket Name value changed to
Client IP value changed to
Server Instance Address value changed to
Opening new session ...
Cookies to be inserted for https://myurl/lightstreamer/create_s...ol=TLCP-2.1.0: <none>
Start message handler
Session ID value changed to Saff0bf8ac9a1ffc2M19aT4954759
Server Instance Address value changed to https://myurl/
Server Socket Name value changed to Lightstreamer HTTP Server
Client IP value changed to xxxxxx
Cookies to be inserted for https://myurl: <none>
WS upgrade error: Invalid handshake response getStatus: 404 Not Found
CONNECTED:STREAM-SENSING
Unable to establish session of the current type. Switching session type WS Streaming->prepare HTTP Streaming
Sending request to the server to force a rebind on the current connection during FIRST_BINDING
Cookies to be inserted for https://myurl/lightstreamer/control....ol=TLCP-2.1.0: <none>
Batch completed
CONNECTED:STREAM-SENSING
CONNECTED:STREAM-SENSING
Failed to switch session type. Starting new session prepare HTTP Streaming
Closing session new.switch.timeout.timeout.FIRST_BINDING.1
Sending request to the server to destroy the current session during FIRST_BINDING
Reset message handler
Session ID value changed to
Server Socket Name value changed to
Client IP value changed to
Server Instance Address value changed to
Stop Protocol
Protocol dismissed
Closing wsc
Session ID value changed to
Server Socket Name value changed to
Client IP value changed to
Server Instance Address value changed to
Opening new session ...
Cookies to be inserted for https://myurl/lightstreamer/create_s...ol=TLCP-2.1.0: <none>
Start message handler
Session ID value changed to Sd47a36c69c7bcb65M19aT5003510
Server Instance Address value changed to https://myurl/
Server Socket Name value changed to Lightstreamer HTTP Server
Client IP value changed to xxxxxxx
Cookies to be inserted for https://myurl/lightstreamer/bind_ses...ol=TLCP-2.1.0: <none>
Keepalive Interval value changed to 5000
CONNECTED:HTTP-STREAMING
CONNECTED:HTTP-STREAMING
CONNECTED:HTTP-STREAMING
Similar Threads
-
By carenot in forum General
Replies: 1
Last Post: May 16th, 2016, 02:59 PM
-
By juicebox225 in forum Client SDKs
Replies: 4
Last Post: January 12th, 2015, 09:36 AM
-
By doraintech in forum General
Replies: 18
Last Post: April 18th, 2014, 11:58 AM
-
By SaravananB in forum Client SDKs
Replies: 1
Last Post: April 11th, 2012, 08:52 AM
-
By JBBUSER in forum Client SDKs
Replies: 1
Last Post: March 24th, 2011, 10:49 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 11:11 AM.
Bookmarks