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

✨ handle resend errors #62

Merged
merged 5 commits into from
Aug 6, 2024
Merged

Conversation

lukas-runge
Copy link
Contributor

Hi @k-yle,

when using the minRefreshRate feature to resend packets continuously the socket might throw errors. One example would be disconnecting and reconnecting the ethernet connection. In this case the unhandled error would crash the whole application and there would be no way for users of the library to catch those and handle those appropriately. This is why I implemented two events that help users handling those cases:

  1. error: contains the Error object for further handling
  2. changedResendStatus: to gracefully recover from disconnection events without necessarily needing to destroy and recreate the Sender instance.

Best regards,
@lukas-runge

Copy link
Owner

@k-yle k-yle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the delayed reply, I wanted to test this with a real console, which I didn't have access to until today. I've left a few suggestions below

src/sender.ts Show resolved Hide resolved
src/sender.ts Outdated Show resolved Hide resolved
src/sender.ts Show resolved Hide resolved
@lukas-runge
Copy link
Contributor Author

lukas-runge commented Aug 4, 2024

Hi @k-yle,

thank you for your feedback! 💯 I've just implemented your suggestions! 🧑‍💻
I think the branch should be ready to merge now. 🚀
What do you think? 🙌

Best regards,
@lukas-runge

Copy link
Owner

@k-yle k-yle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, thanks again for the PR

@k-yle k-yle merged commit 7e194b3 into k-yle:main Aug 6, 2024
8 checks 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