Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of post-bind UDP socket errors #1441

Open
lauckhart opened this issue Nov 25, 2024 · 0 comments
Open

Improve handling of post-bind UDP socket errors #1441

lauckhart opened this issue Nov 25, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@lauckhart
Copy link
Collaborator

lauckhart commented Nov 25, 2024

Currently when matter.js binds UDP socket errors to logs, it dumps any errors after the bind succeeds to logs without additional context.

Instead we should track these errors and pass them to caller on next call to onData. In onData itself we should also interrupt the listen if an error occurs. Possibly should log a warning for send if socket has known error although the OS would maybe handle better in that case so requires additional research.

The prevent problematic interfaces from adversely affecting startup in this case we can also add logic to places where we bind on multiple addresses/interfaces to log errors (including address & interface info) so long as one bind succeeds. If all binds fail then the error(s) should be rethrown.

For that last bit it would probably make sense to also throw if the only successful binds are on loop-local interfaces. In the unlikely case the user has a broken interface and wants a "local only" Matter node they can of course just specify the local interface at startup.

@lauckhart lauckhart self-assigned this Nov 25, 2024
@lauckhart lauckhart added the bug Something isn't working label Nov 25, 2024
@Apollon77 Apollon77 moved this to Planned in [SDK] Matter.js Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Planned
Development

No branches or pull requests

1 participant