I just got an emulator and tried to write the first networking code. In HDiSim it's working good but in the emulator I get an HDDVD_E_ARGUMENT error on Network.createHTTPClient().
Here is the code:
var
INTERNET_URI = "http://172.19.226.151/webcam/test.jpg";var
FC_URI = "file:///filecache/test.jpg";var
PS_URI = "file:///required/test.jpg";var
TIMEOUT = 60;function
downloadFile() { try { //Create request var myHTTPClient = Network.createHTTPClient(INTERNET_URI, Network.HTTP_GET, TIMEOUT); //ERROR HAPPENING HEREmyHTTPClient.downloadFileLocation = PS_URI;
myHTTPClient.onStateChange =
function(pState){ if (pState == myHTTPClient.STATE_COMPLETED){ //Copy from PS to FCFileIO.copy(PS_URI, FC_URI,
true, cbfnCopy);}
else{dbgOut(pState);
dbgOut(myHTTPClient.statusDescription);
}
};
//Send requestmyHTTPClient.send();
}
catch(e) { dbgOut("ERROR: ");dbgOut(e.description);
}
}
In spec I read that a HDDVD_E_ARGUMENT should be thrown if the url is not correct. What's wrong with INTERNET_URI