Comments (3)
Not quite. The Binance websocket doesn't use subscribing. It just connects to an endpoint, and receives data based on what that endpoint is. When a connection is made to an endpoint (say listenkey) which doesn't exist or is expired, the connection attempt will still succeed, it just won't receive any data.
So in the case of a longer network outage, the socket will reconnect just fine, it just won't receive any updates.
You probably can't call a KeepAlive on an expired listenkey, so you'd still need to implement something to restart the stream with a new listenkey when the key is expired.
from cryptoexchange.net.
Not quite. The Binance websocket doesn't use subscribing.
Ah, now I understand your definition of "subscribing".
So in the case of a longer network outage, the socket will reconnect just fine, it just won't receive any updates.
Actually, my analysis tells me that that Binance User Data Stream is not re-subscribed because
where request = null
and this leads to
where handlers without request
s are ignored.
So in the end, it behaves as I need. It's a little bit confusing for me as I don't understand what request
:
is abstraction for.
from cryptoexchange.net.
Request is the request object which is sent to the server when it wants to subscribe. Typically it is a model which looks something like this (just an example):
public class SubscribeRequest
{
public string Method { get; set; } = "Subscribe";
public string Channel { get; set; }
}
This request object is saved for a handler. In case a reconnect happens the socket needs to resubscribe. It then takes all handlers which have such a subscribe request object and resends that same object to resubscribe to the correct channels.
In case of Binance this isn't needed because it automatically starts sending data based on what endpoint you connected to. So for Binance the request objects are null because they don't exist, and in case of reconnect there is no need to send anything.
from cryptoexchange.net.
Related Issues (20)
- Error converting IEnumerable<T> in Result.Error
- Info - CalculateAverageFillPrice by asset quote HOT 1
- Adding a new symbol to a existing subscribtion HOT 3
- unsafe access to subscriptions collection on SocketConnection.ProcessReconnectAsync HOT 2
- request for new common features - withdraw HOT 1
- CallResult Error code is null on request timed out HOT 1
- Proposal: Ability for all Error derived classes to have Code and Data HOT 1
- Remove the ArrayConverter and Cache the New Expressions instead of using Activator.CreateInstance
- It is not possible to change ratelimiters after instantiating the REST client. HOT 2
- Exception "Value cannot be null" in RestApiClient.ParseRateLimitResponse HOT 1
- Hi i'm seeing an exception even though i haven't changed anything HOT 2
- How can i set BaseAddress, BaseAddressUsdtFutures for test url's HOT 2
- Mexc wrapper? HOT 3
- Custom KeepAliveInterval to SocketOptions
- CryptoExchange.Net work with Coinbase Pro's API in the Future???
- Improvement: Add "ExchangeName" to "IRestApiClient" HOT 1
- Common interface for SocketClients
- Miss (Parameter 'accountId')) on common PlaceOrderAsync for Huobi
- SetProxy(ClientWebSocket socket, ApiProxy proxy) Uri.TryCreate in part causes unnecessary errors HOT 1
- Question: Does this library or CryptoClients.Net have built-in support for local orderbook management? HOT 2
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 cryptoexchange.net.