Blockland Forums > Modification Help
Retrieving data from a webserver
Brian Smithers:
--- Quote from: Ipquarx on April 03, 2012, 05:36:47 PM ---I'm trying to recieve data from a webserver, and that data changes often. I need to get all the data, and I need to get it when it changes.
--- End quote ---
i mean like whats the data and what are you doing with the dat.
Ipquarx:
--- Quote from: Brian Smithers on April 03, 2012, 05:43:52 PM ---i mean like whats the data and what are you doing with the dat.
--- End quote ---
In the OP I said:
--- Quote ---(for example, text)
--- End quote ---
And for the second question, I honestly don't see why that matters, except that it will be processed in some way.
Port:
Do you have to use HTTP? If you need a permanent connection, there would be way more efficient solutions.
Ephialtes:
--- Quote from: Ipquarx on April 03, 2012, 05:36:47 PM ---I know HTTP allows something called Persistent connections, but that's all I know.
--- End quote ---
You're probably thinking of the keep-alive directive. This isn't meant to be used for what you're considering, it's mostly to speed up the download of multiple items from a single server.
It wouldn't be that bad to just poll the server every minute or something, but you'd probably need to explain exactly what you're trying to do so someone can suggest the best solution.
Ipquarx:
Allright, I'll tell you exactly what i'm trying to do, and better yet, i'll tell you why.
I'm trying to make a server-sided addon that will receive commands in the form of text from my webserver (password-protected to prevent abuse).
These commands will be used to change preferences, create/edit functions, etc. on the server. No, it is not an eval server. It will not allow eval.
I'm doing specifically that because my computer and network cannot host a network connection. In short, I can't forward any *new* ports.
Which means that both the similar addons to what i'm describing won't work for me.
So..
--- Quote from: Port on April 03, 2012, 09:43:32 PM ---Do you have to use HTTP? If you need a permanent connection, there would be way more efficient solutions.
--- End quote ---
I don't think there are any other ways to connect to a webserver than HTTP, so unless i'm wrong on that part, Yes. I have to use HTTP.
--- Quote from: Ephialtes on April 04, 2012, 01:23:53 AM ---You're probably thinking of the keep-alive directive. This isn't meant to be used for what you're considering, it's mostly to speed up the download of multiple items from a single server.
--- End quote ---
Oh.
--- Quote from: Ephialtes on April 04, 2012, 01:23:53 AM ---It wouldn't be that bad to just poll the server every minute
--- End quote ---
The thing is, once every minute is not that fast, at least, not as fast as I need this to be.