Comments (9)
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 scriptauto_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.
You also need to update the library
from binaryapi.
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.
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.
i will try and write then,thanks
from binaryapi.
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.
What about ssl?
from binaryapi.
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.
Ok, Ill try this
from binaryapi.
Related Issues (20)
- I can't use a handle message function HOT 1
- problem with buy HOT 4
- Websocket problem HOT 9
- Pocket option HOT 2
- Bug Error HOT 6
- Why can't I open a trade? HOT 4
- Payout HOT 1
- hello HOT 3
- ฺBuy For Api But Payout very low HOT 1
- hi, HOT 3
- Problem getting the maximum payment. HOT 1
- Install problem HOT 2
- error HOT 3
- get contract result win or loss HOT 7
- demo balance HOT 3
- API: Top Up Virtual-Money Account HOT 4
- Now other issue HOT 6
- contract payout HOT 4
- Error sending buy or sell HOT 14
- Get all positions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from binaryapi.