C
C#β€’13mo ago
FusedQyou

❔ Best way to set up a websocket and API to access the data?

I'm working on a website that gathers data through a websocket on the backend, using raw UDP packets. The protocol indicates that I can request data, and then immediately receive that data in batches until a special code is retreived to indicate the end of the collection. I want to display this data on the frontend by calling an API to fetch it. The big challenge here is how I set up the backend to properly contain the data. I was thinking of having a background task occasionally fetch the data in an interval, and then have it store the data in a database. The API then always has this data available, or it will wait a bit whilst the newer batch is fetched. Would this be viable, or is there a better way to fetch the data and making sure the API always retrieves the data for the frontend? How can I properly create a background task that is invoked every 5 minutes so that I can fetch the data?
12 Replies
FusedQyou
FusedQyouβ€’13mo ago
For reference, this is the protocol: https://wiki.zandronum.com/Launcher_protocol The initial set up is already done, and I can fetch a list of servers. I just need it to be done properly now.
Zandronum Wiki
Launcher protocol
This launcher protocol lets you to talk to servers and get information from them, allowing you to make your own custom programs like browsers, stat tools, and so on.
Unknown User
Unknown Userβ€’13mo ago
Message Not Public
Sign In & Join Server To View
FusedQyou
FusedQyouβ€’13mo ago
What? πŸ€”
Unknown User
Unknown Userβ€’13mo ago
Message Not Public
Sign In & Join Server To View
FusedQyou
FusedQyouβ€’13mo ago
That doesn't explain it any better πŸ˜„ You're lost read websocket and UDP? I don't get it I have a backend, that must fetch data through a websocket, using raw UDP packets.
Unknown User
Unknown Userβ€’13mo ago
Message Not Public
Sign In & Join Server To View
FusedQyou
FusedQyouβ€’13mo ago
OH, wait yes I meant regular sockets lol I was initially thinking of Websockets but I can't use it here. I really can't modify the socket so I'm forced to use what it supplied. It's a socket communication with raw UDP packets.
Unknown User
Unknown Userβ€’13mo ago
Message Not Public
Sign In & Join Server To View
FusedQyou
FusedQyouβ€’13mo ago
My bad, totally misread
Unknown User
Unknown Userβ€’13mo ago
Message Not Public
Sign In & Join Server To View
FusedQyou
FusedQyouβ€’13mo ago
No, it's an existing socket that I communicate with to fetch a list of servers, specified in the second message Yeah so basically you send a request and the socket immediatley responds with a bunch of packets. Eventually that stops and you can close the socket. There's no longevity or anything else to wait for So I went with Hangfire, and it seems to work properly. https://hatebin.com/lriqqrhquq Just can't figure out how to start the job immediatley I guess I can just activate it manually
Accord
Accordβ€’13mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
❔ Blazor WebassemblyTrying to put an image into a canvas so I can use coordinates to place images in different spots. Tr❔ Log into minecraft with xbox/microsoft apiI was wondering how to authenticate a Minecraft account with Microsofts new account system and if th❔ optimizationSincere question about optimization here... The RenderFirstTab() method is called in an infinite lo❔ How to instantiate derived class when base class requires args?Hey, I'll post the code below but I don't think it'll be necessary as I'm pretty sure I know what th❔ Not sure should I leave the automatic table alteration (postgres EF Core 3.0 to EF Core 6.0)You can see on the picture that EF Core has added some non intentional AlterColumn entries. I guess ❔ Writing VS Extension to Support Language with TextMate Grammar FileHello, I am trying to write extension to support BNF(Backus–Naur form) metalanguage files. I am try❔ Change trigger behavior from code behind(!)Hello again. I am still making a chess game using wpf&wcf. And the problem is that entire board is g❔ Getting SQL data from a relationship tableHello, for my school assignment I have to make a winforms app. Currently I have 3 tables in my SQL D❔ Fast Fourier Transform. I need to make app displaying image and result like ImageJImageJ: https://imagej.net/ij/ So i've chosen to make WPF app because im familiar with it and .NET i❔ βœ… I feel like I've gotten lost in what I'm doing right now, pls help.```cs public async Task DisplayUpdatedTicketsAsync(){ await UpdateTicketsAsync(); DisplayTic