Code Monkey home page Code Monkey logo

Comments (9)

mdn522 avatar mdn522 commented on September 28, 2024

I have added a new example script named auto_reconnect.py in the /examples folder. have a look into that script to get ideas

Notes:

  • If you subscribe to streams when you connect to the Binary websocket server. you need to move those codes into on_connect() function in the script auto_reconnect.py. because whenever the server reconnects you will lose all your previous subscriptions with the server. you have to subscribe again to any streams you need. on_connect() function will be called whenever server connects/reconnects
  • The script is not heavily tested and may contain unseen bugs. use at caution and please report bugs if you find any

from binaryapi.

mdn522 avatar mdn522 commented on September 28, 2024

You also need to update the library

from binaryapi.

Alzabel999999 avatar Alzabel999999 commented on September 28, 2024

Ok,Ill try this. Thanks. Also
I am have a 26 currency. By cycle I call a method to get candle and in callback function get data. But than websocket close. In scrypt I reconnect by methd connec() and have:

DEBUG:binaryapi.ws.client:{"echo_req":{"balance":1,"req_id":2,"subscribe":1},"error":{"code":"AuthorizationRequired","message":"Please log in."},"msg_type":"balance","req_id":2}
DEBUG:binaryapi.ws.client:{"echo_req":{"req_id":3,"subscribe":1,"transaction":1},"error":{"code":"AuthorizationRequired","message":"Please log in."},"msg_type":"transaction","req_id":3}

from binaryapi.

mdn522 avatar mdn522 commented on September 28, 2024

Thanks for the report. there was an issue with the connect() function whenever called more than one time with the same API instance. I tried to fix it and now it should work as intended.

You need to update the library again

from binaryapi.

Alzabel999999 avatar Alzabel999999 commented on September 28, 2024

i will try and write then,thanks

from binaryapi.

Alzabel999999 avatar Alzabel999999 commented on September 28, 2024

HI, I updated library and start at the host. Now all my log full of :

ERROR:root:error reconnect() too many time please look log file

At the start i use binary.connect() and than by cycle use method to get candles. And by your method in the other thread work functions from the auto_reconnect.py

from binaryapi.

Alzabel999999 avatar Alzabel999999 commented on September 28, 2024

What about ssl?

from binaryapi.

mdn522 avatar mdn522 commented on September 28, 2024

You don't have to call binary.connect() at the start because when you create Binary() instance. it automatically calls connect().

Besides may I have a look into your code if it's not confidential.

from binaryapi.

Alzabel999999 avatar Alzabel999999 commented on September 28, 2024

Ok, Ill try this

from binaryapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.