A compatibility wrapper around the BrightScript debug protocol https://developer.roku.com/en-ca/docs/developer-program/debugging/socket-based-debugger.md
Fixes some stability issues when interacting with the debug protocol.
The previous code assumed that we would always get the handshake response first, then the IO_PORT_OPENED update next, and then the rest of the debug protocol was active. However, this is incorrect. The IO_PORT_OPENED could happen at any point throughout the debug session, and should not be assumed to open at the start.
This code properly decouples the IO_PORT_OPENED from the startup logic. now the IO port can be opened at any point, and the connection is considered "open" the moment the handshake is complete.
Fixes some stability issues when interacting with the debug protocol.
The previous code assumed that we would always get the handshake response first, then the IO_PORT_OPENED update next, and then the rest of the debug protocol was active. However, this is incorrect. The IO_PORT_OPENED could happen at any point throughout the debug session, and should not be assumed to open at the start.
This code properly decouples the IO_PORT_OPENED from the startup logic. now the IO port can be opened at any point, and the connection is considered "open" the moment the handshake is complete.