You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm noticing that when a client disconnects, an error event gets emitted on my server's socket.io-stream even though the server stream has already received an 'end' event. I would have expected that the 'end' event would exclude any further events from happening on my server read stream (except maybe 'close'), and that the stream would be cleaned up. Specifically, I would expect Socket.prototype._onend to do something like stream.destroy() or socket.cleanup(id) to the readable end of my stream.
I might be overlooking something, but isn't this a memory leak? How should I close down my streams, if receiving the 'end' event on them doesn't do the job? Should I manually be calling destroy() on an 'end' handler?
The symptom of this problem is that my server-side readable socket.io-stream receives the commands in Socket.prototype._ondisconnect even after it has "ended", particularly the stream.emit('error', new Error('Connection aborted'));. I wouldn't expect stream that I've already consumed to give me some error event a some future time, just because the client eventually disconnects.
Am I missing something? Thanks.
The text was updated successfully, but these errors were encountered:
Hmmmm... I'm not sure whose problem this is. It turns out that in my situation, I hadn't actually turned the stream into flowing mode yet, and never got the 'end' event (although I saw it emitted in the debug logs for socket.io:socket and socket.io-stream:socket). So apparently the stream doesn't get cleaned up from the socket unless you've consumed it, and it will throw this error event on disconnect even if it has already received the end event. :(
I'm noticing that when a client disconnects, an error event gets emitted on my server's socket.io-stream even though the server stream has already received an 'end' event. I would have expected that the 'end' event would exclude any further events from happening on my server read stream (except maybe 'close'), and that the stream would be cleaned up. Specifically, I would expect
Socket.prototype._onend
to do something likestream.destroy()
orsocket.cleanup(id)
to the readable end of my stream.I might be overlooking something, but isn't this a memory leak? How should I close down my streams, if receiving the 'end' event on them doesn't do the job? Should I manually be calling
destroy()
on an 'end' handler?The symptom of this problem is that my server-side readable socket.io-stream receives the commands in
Socket.prototype._ondisconnect
even after it has "ended", particularly thestream.emit('error', new Error('Connection aborted'));
. I wouldn't expect stream that I've already consumed to give me some error event a some future time, just because the client eventually disconnects.Am I missing something? Thanks.
The text was updated successfully, but these errors were encountered: