For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 1 1 1

WebSocket was closed: An exception has occurred while connecting

Unable to connect.

Getting the following:


Connecting to WebSocket ws://192.168.XXX.XXX:15000/WebSocket ...Received Log Event (Level: Fatal): WebSocketSharp.WebSocketException: Not a WebSocket handshake response.
   at WebSocketSharp.WebSocket.doHandshake()
   at WebSocketSharp.WebSocket.connect()

WebSocket was closed: An exception has occurred while connecting.|WebSocketSharp.CloseEventArgs

Connecting to WebSocket ws://192.168.XXX.XXX:15000/WebSocket ...Received Log Event (Level: Fatal): WebSocketSharp.WebSocketException: Not a WebSocket handshake response.
   at WebSocketSharp.WebSocket.doHandshake()
   at WebSocketSharp.WebSocket.connect()

WebSocket was closed: An exception has occurred while connecting.|WebSocketSharp.CloseEventArgs
websocketsrrtorefinitiv-realtime-optimised
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
83.1k 281 53 77

@Cherilyn.Lazaga

I have tested with the C# example in GitHub. It can connect to ADS with the WebSocket connection and retrieve the data properly.

Connecting to WebSocket ws://localhost:15000/WebSocket ...WebSocket successfully connected!


SENT:
{
  "ID": 1,
  "Domain": "Login",
  "Key": {
    "Name": "<user>",
    "Elements": {
      "ApplicationId": "256",
      "Position": "192.168.0.184"
    }
  }
}

However, if I changed the port number from 15000 to another port that is not for a WebSocket connection, such as 14002, I got the following error.

Connecting to WebSocket ws://localhost:14002/WebSocket ...Received Log Event (Level: Fatal): Not a WebSocket handshake response.


WebSocket was closed: An error has occurred while connecting.

You may need to verify the WebSocket connection on ADS works properly. You can use the rmdstestclient or testclient tool available in the ADS package to verify the WebSocket connection. For more information, please refer to the How to test WebSocket connection with rmdstestclient tool article.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.