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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
15 4 3 9

WebSocket API "Connection is already closed"

Hi,

I am testing yours WebSocket API from the provided example market_price.py downloaded from this site.

I get following response "Connection already closed" and would appreciate help on how to solve it.

/market_price.py
Python version 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)]
Websocket_client version 0.53.0

Connecting to WebSocket ws://ap-server1t:14002/WebSocket ...
Connection is already closed.
WebSocket Closed

Kind regards,

Johan

treprdp-apiwebsocketsrrtoconnection
icon clock
10 |1500

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

Upvotes
Accepted
112 2 5 6

Hi Johan,

Port 14002/tcp usually binds the RSSL adapter of the ADS, when WS api listens onto a different port (15000/tcp when using default), are you sure you are addressing the correct port ?

Regards,

Julien

icon clock
10 |1500

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

Upvote
20.3k 73 10 20

Hi @johan.lundquist

Can you confirm that 14002 is the correct port for the server you are connecting to?

The default port for Websocket is 15000 and the 14002 port is actually the default port for RSSL type connections.

icon clock
10 |1500

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

Upvotes
15 4 3 9

Thank you Julien and Umer, you are absolutely right my mistake it works as expected now.

Kind regards,

Johan

icon clock
10 |1500

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

Click below to post an Idea Post Idea