Skip to content

Refactor gWebOverlay to improve socket binding and healing logic - #1377

Merged
Huevos merged 1 commit into
OpenViX:Developerfrom
DimitarCC:hbbtv-fix
Oct 21, 2026
Merged

Huevos merged 1 commit into
OpenViX:Developerfrom
DimitarCC:hbbtv-fix

Conversation

@DimitarCC

Copy link
Copy Markdown
Contributor

This pull request refactors and improves the socket handling in the gWebOverlay class to make it more robust against socket file removal or replacement, and to ensure the overlay can recover automatically if the socket becomes unavailable. The main changes include extracting the socket binding logic into a new method, adding a healing mechanism to monitor and rebind the socket if necessary, and tracking the socket's inode for safe cleanup.

Socket robustness and healing:

  • Extracted the socket binding logic from startListening into a new bindSocket method, improving code clarity and reuse. (gweb_overlay.cpp, gweb_overlay.h) [1] [2]
  • Added an onHeal method and a periodic eTimer (m_heal) that checks if the socket file has been removed or replaced, and automatically rebinds the socket if needed to maintain connectivity. (gweb_overlay.cpp, gweb_overlay.h) [1] [2] [3]
  • Introduced m_sock_ino to track the inode of the socket file, ensuring that only the correct socket file is unlinked during cleanup and preventing accidental removal if another process has rebound the same path. (gweb_overlay.cpp, gweb_overlay.h) [1] [2]

These changes make the overlay's socket communication more resilient to external disruptions and improve maintainability.

@Huevos
Huevos merged commit ed17e24 into OpenViX:Developer Oct 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants