Skip to content
Advertisement

Python websocket closes after few seconds

I am try subscribe API http://developers.xstore.pro/documentation/

Process how I am doing it.

  1. Login (Ok)

  2. Subscribe some command (Ok)

  3. The data starts coming in (Ok)

  4. After few second (cca 20s) (Fail) on:

    JavaScript

Python or API closes connection :(

inicialize socket:

JavaScript

Every 5s I am sending following ping

JavaScript

There is a way to open new connection but this approach it’s not optimal.

Advertisement

Answer

I probably violated some of validation rules or I worked with api with the wrong way.

Anyway I just use library xapi-node for nodejs and one of the wrapper for other languages.

It solve all my problems.

I hope that this will be helpful for somebody in future.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement