-
Notifications
You must be signed in to change notification settings - Fork 980
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
Emit or Ack timeout handling? #309
Comments
See #204 and socketio/socket.io#828 |
If i may suggest this feature in the following releases :) But in the case i am implementing this how am i to battle socket emitting buffered events? Consider the following situation: This is a major drawback in implementing ACK timeout, since any timers/handlers i might implement that will notify me of ack timeout are potentially invalid as the socket may reconnect and emit those events and trigger the acks afterwards....the proper way would be to timeout the acks with the event buffers themselves. Does this make sense? The only solution for now as i see it is to fork the code and make the modifications required for my project? |
In order to accomplish timeout handling, one could just create a timestamp queue in the Socket class, add a timestamp here and check the timestamp here right? |
@AljoSt did you implement this? I'm also thinking about looking into this. Wouldn't the problem with the timestamp approach be that if there is no ack ever, how could you ever check the timestamp? I think perhaps one would add some timeout here and when the timeout occurs and the sendBuffer still contains the message, it should be removed. |
@carlbenson No, unfortunately the project I used socket.io for kinda slowed down to a halt. So I didn't get to implement the workaround. As far as I remember I wanted to use two timestamp checks: |
This feature allows to send a packet and expect an acknowledgement from the server within the given delay. Syntax: ```java socket.emit("hello", "world", new AckWithTimeout(5000) { @OverRide public void onTimeout() { // ... } @OverRide public void onSuccess(Object... args) { // ... } }); ``` Related: - #309 - #517
Here we go: socket.emit("hello", "world", new AckWithTimeout(5000) {
@OverRide
public void onTimeout() {
// ...
}
@OverRide
public void onSuccess(Object... args) {
// ...
}
}); Added in version |
This feature allows to send a packet and expect an acknowledgement from the server within the given delay. Syntax: ```java socket.emit("hello", "world", new AckWithTimeout(5000) { @OverRide public void onTimeout() { // ... } @OverRide public void onSuccess(Object... args) { // ... } }); ``` Related: - socketio/socket.io-client-java#309 - socketio/socket.io-client-java#517
Is there a suggested way how to implement or handle this issue?
The iOS client version has the timeout option, but there is none found on Android SDK.
Without it, we are experiencing difficulties handling use cases where network connectivity is low and sockets are emitted but there are no callbacks if the emit was successful....
The text was updated successfully, but these errors were encountered: