SRL Archive - OSR Help

ReadConnectionData


CX gamer

2011-03-12 09:11:17

Can't get this one to work in the 3.25. Can anyone give me a working example? I want to send multiple http page requests and read the data as soon as it comes in? I also want to manually configure the timeout.
Thanks,

CX

Wizzup?

2011-03-12 16:52:50

You do know that you're using raw sockets, right? So you'll have to implement the HTTP protocol to 'GET' pages.

As for a working example, I only have an incomplete documentation page for you: http://docs.wizzup.org/simba/scriptref/web.html

E: Perhaps this (old) script helps: http://villavu.com/forum/showthread.php?t=54172

CX gamer

2011-03-13 08:50:12

Thanks, I'll fiddle around with it some more. :D

E:
Hmm so how does this work? I'm using

c := CreateSocket();
ConnectSocket(c, '209.85.135.147', '80'); // Connect to google
SetTimeout(c, 5000);

SendSocket(c, 'HEAD / HTTP/1.1');

Wait(2000);
Writeln(RecvSocket(c));
FreeSocket(c);
But it always times out. I want it to check wether or not the data has come in yet or not, if it has, handle it and send the next page request, if it has not, continue checking other sockets. Just for efficiently checking GE prices for my merchanting tool.
I've also been trying to use the Listen, Accept combo but it doesn't work either. Been using http://beej.us/guide/bgnet/output/html/multipage/syscalls.html just to get an idea in what order I should use them, but so far no good. I just don't know what I'm doing.

Can anyone point me into the right direction again please? :$