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

Best Answer

  • julien.dominici
    julien.dominici Explorer
    Answer ✓

    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

Answers

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

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

    Kind regards,

    Johan