feathersjs-ecosystem / socketio

[MOVED] The Feathers Socket.io websocket transport plugin
https://github.com/feathersjs/feathers
MIT License
37 stars 14 forks source link

Disable/restrict failed request queue? #38

Closed ryuken closed 8 years ago

ryuken commented 8 years ago

Hi I'm searching for a way to disable or restrict the failed request queue to 1. So basically socket.io queue's failed requests when network connection is gone and resends those when connection resumes.

How can I stop this behaviour or restrict the maximum amount of requests?

daffl commented 8 years ago

I found this SO answer to set the Socket.io max reconnection retries. Not sure if that is what you are looking for. You might have more luck finding an answer in the Socket.io channels or GitHub.

ryuken commented 8 years ago

Nah that's the reconnection timings. If the connection is lost and you still try to do stuff, the client will queue those requests and send them when reconnected.

I solved it by checking if there is any internet connection in all actions lol, but its a kinda crappy solution. I wish there was a way to stop this behaviour of socket.io

Primus does have a queueSize option, but I couldn't make Primus work with socket.io

ekryski commented 8 years ago

@ryuken care to post the solution for reference? 😁

ryuken commented 8 years ago

I didn't solve it with socketio (they don't support this). I checked if there is any internet connection before dispatching my events lol.