From 4c899861b1dedce9addccd6a31dcff6f7bf602eb Mon Sep 17 00:00:00 2001 From: JKorf Date: Fri, 1 Mar 2024 14:25:38 +0100 Subject: [PATCH] Docs --- docs/index.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/index.html b/docs/index.html index 7449077..87607bf 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2701,7 +2701,13 @@ var listenKey = await binanceClient.SpotApi.Account.StartUserStreamAsync(); // Subscribe using the key await binanceSocketClient.SpotApi.Account.SubscribeToUserDataUpdatesAsync(listenKey.Data, data => { // Handle update -}, null, null, null); +}, null, null, null); + +// The listen key will stay valid for 60 minutes, after this no updates will be send anymore +// To extend the life time of the listen key it is recommended to call the KeepAliveUserStreamAsync method every 30 minutes +_ = Task.Run(async () => { + await binanceClient.SpotApi.Account.KeepAliveUserStreamAsync(token.Data); +});
await bitfinexSocketClient.SpotApi.SubscribeToUserUpdatesAsync(orderHandler: data => {
@@ -2749,6 +2755,12 @@ var token = await mexcClient.SpotApi.Account.StartUserStreamAsync();
 // Subscribe using the key
 await mexcSocketClient.SpotApi.SubscribeToOrderUpdatesAsync(token.Data, data => {
     // Handle update
+});
+
+// The listen key will stay valid for 60 minutes, after this the connection is closed and reconnecting with the same listen key will fail
+// To extend the life time of the listen key it is recommended to call the KeepAliveUserStreamAsync method every 30 minutes
+_ = Task.Run(async () => {
+    await mexcClient.SpotApi.Account.KeepAliveUserStreamAsync(token.Data);
 });