Author Topic: Retrieving data from a webserver  (Read 1682 times)

How can I retrieve data from a webserver (for example, text) that may change periodically, without having to repeatedly connect to it? Like keeping the conection open, and receiving updated data, etc.

does torque even support retaining a connection in this manner?

first you should start off by saying what your doing.
Though you can't always be connected, I've tried that and it disconnects eventually.

does torque even support retaining a connection in this manner?
I know HTTP allows something called Persistent connections, but that's all I know.

first you should start off by saying what your doing.
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.

How do you retrieve text from a website?

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.
i mean like whats the data and what are you doing with the dat.

i mean like whats the data and what are you doing with the dat.
In the OP I said:
Quote
(for example, text)

And for the second question, I honestly don't see why that matters, except that it will be processed in some way.

Do you have to use HTTP? If you need a permanent connection, there would be way more efficient solutions.

I know HTTP allows something called Persistent connections, but that's all I know.

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.

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..
Do you have to use HTTP? If you need a permanent connection, there would be way more efficient solutions.
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.

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.
Oh.

It wouldn't be that bad to just poll the server every minute
The thing is, once every minute is not that fast, at least, not as fast as I need this to be.
« Last Edit: April 04, 2012, 04:36:57 PM by Ipquarx »

Apologies if I'm misinterpreting you; you're going to have a remote webserver that your server connects to because you can't host anything locally ("Which means that both the similar addons to what i'm describing won't work for me.", do you mean my remote control mod?) and that server will send back any commands?

HTTP is not built for things like this. Just use plain TCP sockets. There are plenty of places you can host worker applications for free (Heroku, dotCloud, etc.). Use something like Python, Ruby or Node.

NOTE: Heroku is the nicest, but it pauses idle servers.

There are plenty of places you can host worker applications for free (Heroku, dotCloud, etc.). Use something like Python, Ruby or Node.
you just made my day

So..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.

You shouldn't use a webserver for this at all.

Apologies if I'm misinterpreting you; you're going to have a remote webserver that your server connects to because you can't host anything locally ("Which means that both the similar addons to what i'm describing won't work for me.", do you mean my remote control mod?) and that server will send back any commands?
Exactly, and yes one of the two i'm talking about is your remote control mod.
HTTP is not built for things like this. Just use plain TCP sockets. There are plenty of places you can host worker applications for free (Heroku, dotCloud, etc.). Use something like Python, Ruby or Node.
If only I could figure out how to use those.

If only I could figure out how to use those.

Which field are you talking about? Server or client?