I have a working connection between my Chrome sender and the ChromeCast, as in I can properly send and receive messages between the two, but every time a sender connects, it creates a new connection while incrementing what I guess to be a session variable: ws://localhost:8008/session?x , where x is the number incremented.
I would like to know two things:
Why does it increment the session variable on every connection ? Is it by design ? Or am I failing to close the connection properly ? From what I can see the connection sends a close event by default but I could be wrong.
If the session is renewed by design, is there a way to detect previous sessions and connect to those if one side is still active ?
EDIT: I understand that the Chrome sender APIs do not support the multiple connection scenario described in the Android TicTacToe demo application, but my purpose for asking is because when this 'session' variable is incremented to a certain point other applications, such as the YouTube Android app, begin to preform irregularly, seemingly because of lag in the WebSocket connection. I would really like to know why this connection is being incremented. From my testing it is purely by design, likely to ensure each client gets a unique connection to the ChromeCast ( ie to prevent the multiple controller scenario noted below ).
The current Chrome APIs do not support re-using an existing connection (unlike, say, Android APIs that do support such a scenario). This is known limitation that will be addressed in future.
HTH, Ali.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With