Hello!
I've been developing a BlackBerry 10 remote for Media Center using MCWS, but I'm having trouble making connections when authentication is enabled.
The current flow of my app is:
1) Make a Browse request, ID=0
2) Get an "Auth Required" response from MCWS
3) Get the stored credentials from the settings (or prompt user to go to settings if there are no credentials)
4) Make an Authenticate request with the credentials, retrieving an Auth token which is appended to all future calls
5) Make the Browse request again (with the token)
When I make the 2nd Browse request, I get a "Bound address already in use" error from the platform. It seems if I wait a bit and retry the Browse request, the request will return a response. I have also tried configuring my QNetworkAccessManager to handle authentication on its own - without calling MCWS' Authenticate - but I experience the same failure. I believe QNAM just caches the credentials and passes them when the server requests them.
Even after I get a response from the Browse request, sometimes other requests fail sporadically. My app makes a relatively large number of connections in a short time frame when browsing because it needs to pull down all of the images. Cascades doesn't require images for all of the items as soon as the page loads, but it does buffer the items on screen + a few ahead and behind in the list. The QNetworkAccessManager handles request queuing internally, making at most 6 connections to a single host in parallel. But it seems when authentication is enabled MCWS can't keep up and some of the requests fail.
I just experienced a similar issue with Chrome. I tried hitting
http://localhost:52199/MCWS/v1/ and was prompted for credentials, but when I entered them Chrome immediately returned a connection error and the page didn't load.
All this being said, when I turn authentication off, I don't experience any issues. Has anyone else experienced anything similar?
Thanks!
-Lenny
PS- thank you very much for making these APIs, and for making them so simple to use! I've been having a lot of fun toying around while creating this app over the past few weeks.