bitfinex-api-node | BITFINEX NodeJS trading API - Bitcoin, Litecoin, and Ether exchange | Websocket library
kandi X-RAY | bitfinex-api-node Summary
kandi X-RAY | bitfinex-api-node Summary
BITFINEX NodeJS trading API - Bitcoin, Litecoin, and Ether exchange
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get the pulse statistics
- Hide current page
- Scroll to next item
- Translates a single line string .
- this function is used as the dom tree
- Parses characters in a string
- parse h
- interpolates the current document
- Checks if a character contains a text .
- Cross - browser implementation .
bitfinex-api-node Key Features
bitfinex-api-node Examples and Code Snippets
Community Discussions
Trending Discussions on bitfinex-api-node
QUESTION
my node-js application uses the bitfinex-api-node npm package to establish a websocket connection to receive data from the Bitfinex crypto-currency exchange.
Unfortunately, the connections silently breaks after some hours and the app stops receiving data over the websocket. This seems to be a known issue, maybe a bug of the bitfinex-api-module.
Now, I'm trying to "manually" reconnect by first connecting the websocket and subscribing to some candle data. Then the websocket.close() function gets called to simulate a connection error at runtime. In the on close function I set another timeout and try to create a new BFX() object and open() it but .on(open) never gets called.
=> I must be doing something wrong. Is there a mistake in my logic? Is there a better way to reconnect?
The following code works, just copy paste it and run to see for yourself. I am very thankful for any hints or tips.
...ANSWER
Answered 2018-Feb-26 at 07:56The problem is that you don't attach any listeners to a new instance of websocket, when a previous one is closed:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install bitfinex-api-node
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page