You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to listen to the user's orders instantly over the socket by using "BybitSocketClient". But when I use the relevant code block in using(), I cannot listen to user actions. The socket is not working.
When I don't use the using() block, I can listen for sockets.
Working Code:
var socketClient = new BybitSocketClient(new BybitSocketClientOptions
{
ApiCredentials = new ApiCredentials(_appSettings.ExchangeSettings.ApiKey, _appSettings.ExchangeSettings.SecretKey)
});
await socketClient.SpotStreamsV2.SubscribeToAccountUpdatesAsync(
accountUpdate =>
{
if (accountUpdate is not null)
{
}
}, orderUpdate =>
{
if (orderUpdate is not null)
{
}
}, stopOrderUpdate =>
{
if (stopOrderUpdate is not null)
{
}
}, tradeUpdate =>
{
if (tradeUpdate is not null)
{
}
}, stoppingToken);
}
Notworking Code:
using (var socketClient = new BybitSocketClient(new BybitSocketClientOptions
{
ApiCredentials = new ApiCredentials(_appSettings.ExchangeSettings.ApiKey, _appSettings.ExchangeSettings.SecretKey)
}))
{
await socketClient.SpotStreamsV2.SubscribeToAccountUpdatesAsync(
accountUpdate =>
{
if (accountUpdate is not null)
{
}
}, orderUpdate =>
{
if (orderUpdate is not null)
{
}
}, stopOrderUpdate =>
{
if (stopOrderUpdate is not null)
{
}
}, tradeUpdate =>
{
if (tradeUpdate is not null)
{
}
}, stoppingToken);
}
The text was updated successfully, but these errors were encountered:
Hello,
I am using Bybit.Net v1.5.2.
I want to listen to the user's orders instantly over the socket by using "BybitSocketClient". But when I use the relevant code block in
using()
, I cannot listen to user actions. The socket is not working.When I don't use the
using()
block, I can listen for sockets.Working Code:
Notworking Code:
The text was updated successfully, but these errors were encountered: