The current '_doWrite' will push the _doFlushSendQueue callback
to the event loop queue after a successful write.
The problem is that the socket might be closed by the time the
enqueued _doFlushSendQueue callback gets called, and in this case,
it would just crash hard with the following error:
TypeError: Cannot read property 'write' of null
We can avoid this issue by enforcing the logger to call the waitToWrite
routine before _doFlushSendQueue.
What is this patch?
The current '_doWrite' will push the
_doFlushSendQueue
callback to the event loop queue after a successful write.The problem is that the socket might be closed by the time the enqueued
_doFlushSendQueue
callback gets called, and in this case, it would just crash hard with the following error:We can avoid this issue by enforcing the logger to call the
waitToWrite
routine before_doFlushSendQueue
.Note
This patch fixes the issue reported by #83.