Closed deyhle closed 8 years ago
Hi Ruben,
It's possible that the reason you're seeing the remote end drop the connection is because EventStore thinks that the connection is idle and not being used. I'd recommend using the Connection.sendPing function on a regular basis to keep the connection alive.
There's currently no easy way with this library to handle socket-level errors such as remote disconnection, but you're welcome to submit a Pull Request if you want to go ahead and implement support for handling them.
This case duplicates #8
Apparently it's another issue. I added sendPing requests now that fire every 5 minutes, but I see the following in the log:
2016-07-11T07:26:42.289Z - info: connected to eventstore
2016-07-11T07:31:42.278Z - debug: received pong response from eventstore
2016-07-11T07:36:42.280Z - debug: received pong response from eventstore
-- many more in 5 minute intervals --
2016-07-11T11:06:42.304Z - debug: received pong response from eventstore
2016-07-11T11:11:41.652Z - error: Error: This socket has been ended by the other party
at Socket.writeAfterFIN [as write] (net.js:278:12)
at ...
I'll probably make new connections now to solve the problem.
After a few hours I always get the error
My code (the line 43 from the stacktrace is the one with
eventStore.writeEvents
):Is there any way to react to a disconnect?