-
-
Notifications
You must be signed in to change notification settings - Fork 54
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 send error #34
Conversation
# Conflicts: # socketioxide/src/errors.rs # socketioxide/src/socket.rs
1b36eba
to
8de4a86
Compare
@Totodore that's a solution, but I put one todo, in case of error appears in binary payload send, will fix it when have time |
@Totodore Done. should we mention how many packets remaining inside of the closure? |
Also I added dependency to easily implement Debug for Errors including closure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the idea of the closure, I didn't considered this solution before you proposed it but it is very elegant.
@Totodore in the last commit I replaced closure with Retryer struct. What do you think about that? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The retryer way is better, I like it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging
One thing that it is important to note is that due to the possibility to retry to send binary packet it could lead to binary desynchronization. EngineIo binary packets have to be sent next to the event packet, so if there is a retry for a binary packet error and that between the original attempt and the retry there is another event packet sent it will break the mecanism. |
So I will think how to handle it. Looks like Socket should own buffer of failed messages to send them firstly or another |
use closure to handle fullchannel error, test checking it
resolves #27