Philipp Lamp

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:

Code Snippet

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 HERE

myHTTPClient.downloadFileLocation = PS_URI;

myHTTPClient.onStateChange = function(pState){

if (pState == myHTTPClient.STATE_COMPLETED){

//Copy from PS to FC

FileIO.copy(PS_URI, FC_URI, true, cbfnCopy);

}else{

dbgOut(pState);

dbgOut(myHTTPClient.statusDescription);

}

};

//Send request

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



Re: HD DVD Interactivity Authoring HDDVD_E_ARGUMENT in Networking code

Clinic

Hey there,

oddly I am working on this very thing right now. I too recieved the same error, but my URI read like this:

var INTERNET_URI = "url(http://myweb.com/disc000001/pic01_ver.jpg')";

after reading through the spec, I changed the value to an HTTP 1.1 compliant string:

var INTERNET_URI = "http://myweb.com/disc000001/pic01_ver.jpg";

this solved the HDDVD_E_ARGUMENT, but I cannot get out of my emulator to a server on the Internet. (Guess I should hook up a web server the emulator can see.) After this was solved, I could only get to the STATE_LOADING state of the send() request.

So, looking at your code above, I don't believe you should be getting the HDDVD_E_ARGUMENT error. I don't think this should do anything, but try commenting out the FileIO line just to ensure that isn't kicking out the error.

Also, if you could give me a hint in hooking up the emulator to see a webserver I would much appreciate. I am currently backtracking to HDiSim to see if I can get it working there.

thx






Re: HD DVD Interactivity Authoring HDDVD_E_ARGUMENT in Networking code

Clinic

I just tested the exact same INTERNET_URI value you have and I did not recieve the error. I suspect there is something wrong in the other URI's Have you created the PSTORAGE dir yet Have you setup your DISCID.DAT yet

I notice that your PSTORAGE variable does not indicate content ID.

var PS_URI = file:///required/test.jpg;

it should look more like this

var contentID = "1CFD5B4D-2CD1-3B55-4164-5A7B6165EC88";

var PS_URI = "file:///required/" + contentID + "/";

(use GUIDGen.exe that comes with VS 2005 to get GUID's to populate your DISCID.DAT)






Re: HD DVD Interactivity Authoring HDDVD_E_ARGUMENT in Networking code

Clinic

After a few hours of setting up a webserver and testing, I still can't get the emulator to respond... It seems to be supporting some Network API, but no dice on grabbing any PNG's or info from the localhost which is wired to http://172.16.0.5/. hmm...

To keep this in context of HDiSim, these functions are working just fine, and also operate well in the Internet realm.






Re: HD DVD Interactivity Authoring HDDVD_E_ARGUMENT in Networking code

Philipp Lamp

it's not the PS_URI. The same happens when trying to download directly to the filecache.

Meanwhile I changed the IP address to the computer's network name (http://hd-authoring2/webcam/test.jpg). Now the previously mentioned error isn't there anymore (seems that it shouldn't be an IP) but now I get a error message "No connection could be made to the server".

Are you using toshiba emulator Your webserver itself is working also for other PCs on the network There are some apache settings that can make it look like it's working when only trying from localhost.





Re: HD DVD Interactivity Authoring HDDVD_E_ARGUMENT in Networking code

Peter Torr - MSFT

HD DVD explicitly disallows dotted-IP addresses. You must have a registered DNS name and the player (emulator) must be set up with the right settings. I have always seen emulators set up with static IP addresses (and no DNS server) so it won't be able to resolve the name to an IP address. Try changing the config so it gets a DHCP address.

Also, depending on how up-to-date the emulator is, it may be trying to make an HTTPS connection first (this was an old part of the spec that was recently removed). Can you look at the logs on the server to see if it even gets a request from the emulator Can you run a network sniffer and see what the emulator is doing






Re: HD DVD Interactivity Authoring HDDVD_E_ARGUMENT in Networking code

Peter Torr - MSFT

Actually the content-id in the PStore URI is optional; if you don't specify it then the file will be downloaded into the "common" area for the publiser.

Also, you can get the value at run-time by querying PersistentStorageManager.contentId. Then you don't have to hard-code it into your source.






Re: HD DVD Interactivity Authoring HDDVD_E_ARGUMENT in Networking code

Peter Torr - MSFT

Finally, whilst you can use HDiSim for network testing, there have been several changes to the network APIs in recent supplementals to make it more conformant with other specifications and to make content authoring more robust. You will not be able to take your working HDiSim code and just put it on a real player, although unless you are doing all sorts of edge-case things with HTTP headers or sending unexpected HTTP response codes from the server, the changes will be relatively minor.

As one minor example, the abort() method no longer takes a parameter, since the onStateChange function serves that purpose.






Re: HD DVD Interactivity Authoring HDDVD_E_ARGUMENT in Networking code

Clinic

I am using the Emulator version TN2002_R1_TypeA.

I have setup a webserver with Microsoft IIS.

I did read something about HTTP 1.1 that indicated IP addresses in URLs should be avoided.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html

If the port is empty or not given, port 80 is assumed. The semantics are that the identified resource is located at the server listening for TCP connections on that port of that host, and the Request-URI for the resource is abs_path (section 5.1.2). The use of IP addresses in URLs SHOULD be avoided whenever possible (see RFC 1900 [24]). If the abs_path is not present in the URL, it MUST be given as "/" when used as a Request-URI for a resource (section 5.1.2). If a proxy receives a host name which is not a fully qualified domain name, it MAY add its domain to the host name it received. If a proxy receives a fully qualified domain name, the proxy MUST NOT change the host name.






Re: HD DVD Interactivity Authoring HDDVD_E_ARGUMENT in Networking code

Clinic

URI going further.

this is proof of what Peter says below:

http://www.ietf.org/rfc/rfc1900.txt

This links mentions the need for the HTTP 1.1 request for Comments 1900, which recommends the removal of IP addresses in favor of DNS to address the renumbering problem. My guess is that this is part of the problem with the original code posted.

Now, if I can figure out how to get this emulator running locally.






Re: HD DVD Interactivity Authoring HDDVD_E_ARGUMENT in Networking code

Peter Torr - MSFT

This may be a dupe since I already replied (3 times...) and couldn't see the answer. But...

  1. HD DVD does not allow dotted-IP addresses; only names. But by default the emulator will be set up with a static IP and no DNS, so it won't be able to resolve names anyway. Change it to use DHCP and you should be OK
  2. Depending on how old the emulator is, it may still be trying to make an HTTPS connection first; see if you can check the logs on the server (or run a network sniffer) to see what is going on. (Note that HTTPS connections are now optional in the spec, not required)
  3. Finally, HDiSim is pretty old too. Most of the code should work OK in real players (most of the spec changes have been for edge cases, error conditions, etc.) but you will still need to test once you have the code written in HDiSim.






Re: HD DVD Interactivity Authoring HDDVD_E_ARGUMENT in Networking code

Clinic

Thanks for the content ID twist Peter.

So, I switched over the Ethernet to DHCP, hooked the emu up strait up to a non-firewalled connection, entered a bonified http address online, but still my onStateChange function stops at STATE_LOADING. I performed 10 more variations of the code, but still nothing. (Wow, what a pain in the CAT5.)

  1. I'll have to contact the web admin to view the log on these attempts. argh.





Re: HD DVD Interactivity Authoring HDDVD_E_ARGUMENT in Networking code

Philipp Lamp

@Peter do you think the player can handle "Windows Computer Names" or is it necessary to have an entry in the DNS Server Perhaps I should ask our IT about adding a DNS entry for my test server

Clinic, are you sure that the network setup is correct No (non-transparent) Proxies between or something Did you wait until the timeout to get an error message





Re: HD DVD Interactivity Authoring HDDVD_E_ARGUMENT in Networking code

Peter Torr - MSFT

The spec doesn't call for WINS resolution, so I doubt the Toshiba player does it. Any network with a Windows Domain Controller should be able to do DNS pretty easily for the clients though.

How old is your emulator If it hasn't been updated recently, I have no idea what it will be doing.






Re: HD DVD Interactivity Authoring HDDVD_E_ARGUMENT in Networking code

Clinic

I am working on contract right now, so I've got to figure out what is going on with the network. I'll have to get ahold of IT to verify that this emulator is configured correctly through DHCP. Thankfully, this disc won't have network, but I am conducting R&D to prep for future use. The emulator I've got is very new as they just got it, and it's been updated to a very recent firmware version. TN2002_R1 type A.