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.

@Cherilyn.Lazaga

This is a public forum so it is not suitable to post the client's email in the question.

Therefore, I have removed the client's email.

Hi @Cherilyn.Lazaga ,

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,
AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,
AHS

1 Answer

· Write an Answer
Upvotes
Accepted
79.2k 251 52 74

@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.