AnonymousSeptember 9, 2010 at 9:14 pmPost count: 2
I am working on a quick proof of concept for web app with a simple touch interface. I noticed a few things while working on it.
The ReadCluster and WriteCluster commands are documented in the v2 api as having responses with the same names, but it seems like I am getting a ClusterResponse for both. It is not to hard wait for the ClusterResponse with the correct device for the Read or Write that I sent.
The next problem showed up because my web server was stateless so each request was opening a new tcp connection. Quickly toggling 2 devices sends two ajax calls which opens two tcp connections to the EZSrve each trying to read the current state and update it. I was seeing was the second request work and the first wait for a ClusterResponse that never came. Serializing the requests in my server or keeping a single connection worked as a workaround, but and it seems that if any other connection sends a request while another is waiting for a response both responses are sent to the connection with the last request.
I am not sure what the correct behavior is. On a WriteCluster I could not wait for a response and hope it worked. On a ReadCluster I could resend the request if I don’t get a response after some timeout. But this seems like it would also cause problems if you wanted to be able to update a UI in real time with the asynchronous ClusterResponses because you would never be able to tell if you missed any.
A copy of the library I am using to access the EZSrve is at GitHubAnonymousSeptember 25, 2010 at 2:47 amPost count: 2
I have build a proxy that sends all responses from the ezserv to all the connected clients. It makes sure the that request to the ezserv are not intermixed. It also adds a delay between commands that I have found helps making sure you get a response. Clients using it need to be able to handle getting any response at any time., but other than that nothing special is needed. I have been running it on my wireless router without any problem so I still don’t need a PC on all the time.
I have a bad video of the harmony client and my web interface both getting updates at the same time.
- You must be logged in to reply to this topic.