I had some problems with this in Haraka recently. Turns out I needed to
check if the actual TLS socket was writable before attempting a write.

This is the relevant commit in case it helps:

https://github.com/baudehlo/Haraka/commit/8aafb8d170e97a2979b7e1a7d8434ab5909d9bca

The key part is outbound.js line 791, and passing the writeable flag up the
chain in tls_socket.js

Matt.

On Fri, Jun 8, 2012 at 10:59 PM, catshow <[email protected]> wrote:

> I am working on a new Apple Push Notification server using node.js.  I am
> having issues with node not emitting the close event on a TLS SecureStream
> after getting an EPIPE error event.  Has anyone else had this happen?  It
> appears to happen after I do a lot of reconnects back to apple after
> generating invalid device id's.  It does not happen each time.
>
> How should I force it to close?  I am doing a hack that will schedule a
> timer to fire 250 ms after the ERROR event and then call the
> connection.destroy() method.  Is there a better way to handle this?
>
> TIA
> Garry
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to