Post your code.
function Downloader::onDNSResolved(%this)
{
echo("DNS Resolved");
}
function Downloader::onDNSFailed(%this)
{
echo("DNS Failed");
}
function Downloader::onConnected(%this)
{
echo("Connected");
%req = "GET "@$file@" HTTP/1.0\r\n";
echo(%req);
%this.send(%req);
}
function Downloader::onConnectFailed(%this)
{
echo("Connection Failed");
}
function Downloader::onDisconnect(%this)
{
echo("Disconnected");
}
function Downloader::onLine(%this, %line)
{
echo("TCP: " @ %line);
if(strPos(%line,"Content-Length:") >= 0)
%this.length = getWord(%line,1);
//ONLY NEEDED IF SAVING THE FILE
if(%line $= "")
%this.setBinarySize(%this.length);
}
//ONLY NEEDED IF SAVING THE FILE
function downloader::onBinChunk(%this,%chunk)
{
echo("chunk'd");
if(%chunk < %this.length)
return;
%path = "config/server/TCP example.txt";
%this.saveBufferToFile(%path);
%this.disconnect();
}
function defaultconnect()
{
if(!isobject(Downloader))
return;
$ip = "98.227.200.17";
$file = "/shares/USB_Storage/testdoc.txt";
echo("Sending connect request to "@$ip@" for "@$file);
Downloader.connect($ip@":80");
}
if(isobject(Downloader))
Downloader.delete();
new tcpobject(Downloader);
==>defaultconnect();
Sending connect request to 98.227.200.17 for /shares/USB_Storage/testdoc.txt
Connected
GET /shares/USB_Storage/testdoc.txt HTTP/1.0
DisconnectedI just copied and pasted the onbinchuck function out of some other coding help topic somewhere, I'm thinking it was the one ipq linked.
I also verified to make sure it was working by sending a request to forum.blockland.us and it downloaded some broken html something that ends like halfway through a line of code, but it still was called. I'll attach it in case someone cares.
There is about a five second delay between when the GET request is sent and Disconnected appears
Also I have tried like a million variations on the GET request, but this is the one that I am pretty sure Ephialtes indicates is best.