Closed SamuelEarl closed 6 years ago
Hi, have you fixed the issue? I have the situation.
@heldercruvinel it's the same situation with the same example ? If do you have another example send to us and I'll try to check :D
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
I am trying to use a publication/subscription model and I am seeing some errors that I can't debug. I am pretty sure they are related to the client closing the WebSocket connection, but I don't know how to fix the problem.
Here is my code:
server.js
:client.js
:The strange thing is that I am successfully using pubs/subs in other parts of my app, but this particular instance throws weird errors. For example, I tried using the
server.broadcast()
pattern and I would see "Message from the server" in my browser console on occasion, but most of the time I wouldn't see anything. After switching to the pub/sub pattern from the above code snippets, I haven't seen any message from the server in my browser console.I have seen this error in my server's terminal window at random times, but not consistently:
I tried the following code and it gave an
Uncaught (in promise) Error: Cannot connect while client attempts to reconnect
error in the browser console:server.js
:client.js
:If I comment out the block that is documented with
// Subscribe to "/collections-array" publication
, then I will see "API Endpoint" in the browser console.I read that I just have to handle the
ECONNRESET
error and it should fix the problem, but I thought I was already doing that with the try/catch blocks.Any ideas as to what is going on?
Thank you!