Open oreynaldocl opened 8 years ago
It's up to you to discover lost connections.
Ok, I am adding connection states controls. This also happen if the process is busy and the connection is lost.
DDP does specify a ping/pong mechanism you can leverage for this
Yep, I am testing and the connection is always recovered, that is a great feature. But I need to add a control to avoid perform an action (call, subscribe, close) if the connection is recovering.
I checked the code and the action is never sent if the connection is recovering and DDP doesn't have a way to retry the action.
This is really nasty stuff, I get connection lost every time I call particular method. Method always successfully work on server but then callback never return because connection silently get down. When on timeout I make ddpclient.close and then .connect, randomly every 40-90 seconds I get socket-close event firing, so connection closing and then recovering and then closing, infinitely.
Hello. I found an interesting problem. It only happened when I debugged my code. If for some reason I lose the connection of DDP(not closed or error) if I call .subscribe or .call the callback is never called. Debugging I lost the connection because the socket can't resolve ping-pong process and it set its readyState to 2 I debugged really deep and I found this code
This condition
if (this.readyState > API.OPEN)
is true and the socket never sends the message but the DDP added the callback but it never has an answer message for this callback and it will been waiting forever for this callback.Without debugging this error never happens, but I think is really dangerous that the DDP don't manage this problem, it can happen and the DDP will wait forever.
Anybody had this problem?