baudehlo/Haraka — Issue #153: Error writing to closed socket
Author: sstur
Created: 2012-01-23 07:08:12+00:00
State: open

In rare cases I received the following error when sending mail:

Error: This socket is closed.
at Socket._write (net.js:451:28)
at Socket.write (net.js:444:15)
at pluggableStream.write (/usr/local/lib/node_modules/Haraka/tls_socket.js:96:34)
at pluggableStream.send_command (/usr/local/lib/node_modules/Haraka/outbound.js:728:14)
at [object Object]. (/usr/local/lib/node_modules/Haraka/outbound.js:844:36)
at [object Object].emit (events.js:88:20)
at afterRead (fs.js:1111:12)
at Object.wrapper [as oncomplete] (fs.js:254:17)

Would the correct solution be a try/catch like this:
https://github.com/sstur/Haraka/commit/0ffae89447e7b8f5aa2b1307c76ddfe3512b7888

Or a callback?