patternleaf / archway

Work on the archway project.
1 stars 0 forks source link

Chrome extension unresponsive after client reconnects. #3

Open coil-lighting opened 9 years ago

coil-lighting commented 9 years ago

I can start the chrome extension either before or after the Udder server, no problem. If I start it after the Udder server, I just have to wait for up to 10 seconds before Udder attempts to reconnect, and then the simulator comes to life. (Actually, both cases are equivalent: starting the sim before or after Udder.) All good.

However, if I terminate the Udder server (in order to apply a bugfix) and then restart Udder, the sim holds the last look until Udder reconnects, then the sim draws a black frame and becomes unresponsive. At that point I have to kill the sim in the Chrome Extensions window.

Suggestion: It would definitely smooth out development for clients like Udder if we could figure out how to make the sim recover gracefully from sudden connection loss, so that it can accept subsequent reconnects. I have to kill Udder, recompile, and restart every 30 seconds while I'm debugging.

MB

patternleaf commented 9 years ago

Hey Mike -

I added a simple timeout when nothing is heard from the client for 5 seconds. Server resets itself. Pretty crude but seems to work with your basic use case assuming udder sends frames at a consistent rate. Let me know if that helps or not.

coil-lighting commented 9 years ago

Okay, I'll try it.

In a perfect world we'd make it sufficiently intelligent that if a user configured the client to send frames slowly (in order to exercise FadeCandy's onboard interpolation), we'd adapt. I think that might require supporting multiple connections from clients, where the latest connection trumps the old one. Clearly not required for the Archway project, but worth considering if you're planning to convert this to a standalone app.

MB

patternleaf commented 9 years ago

Yup. Let's leave this issue open even if this addresses your immediate needs. Thanks.