Hi - apologies my question is a simple one.
I am building a dotnet app to stream some data using websockets and I decided to use the binance nuget package to connect to the websocket.
I used to examples in a console app but (as it clearly states) returns only one result. When using postman with the same url, I get multiple results. I am not sure what needs to change to have this running as a long running process. Any help is appreciated.
Sample from git code
var websocket = new MarketDataWebSocket("btcusdt@kline_5m");
var onlyOneMessage = new TaskCompletionSource<string>(); // I am assuming this is what should change
websocket.OnMessageReceived(
async (data) =>
{
onlyOneMessage.SetResult(data);// I would like to replace this a function call but not sure how
}, CancellationToken.None);
await websocket.ConnectAsync(CancellationToken.None);
string message = await onlyOneMessage.Task;
logger.LogInformation(message);
I am new to Websockets and I am bit confused because I could get it working with other packages, but I prefer to use this nuget.
Many thanks