Does socket.destroy() imply/include socket.end()?

1,045 views
Skip to first unread message

Michael Hasenstein

unread,
Jul 16, 2015, 2:52:28 PM7/16/15
to nod...@googlegroups.com
Because I think it should, but it doesn't, see this issue I debugged in node-imap today:


Basically, calling socket.destroy() did not end the connection. I had to add a socket.end() in front to make it work.

Fedor Indutny

unread,
Jul 16, 2015, 3:02:07 PM7/16/15
to nod...@googlegroups.com
Hello!

You may want to give a try to: socket.destroySoon(). socket.destroy() - is supposed to kill the socket as soon as possible.

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 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 unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/ae7c8c44-d545-4522-a66f-33df378bbd38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Hasenstein

unread,
Jul 16, 2015, 3:09:59 PM7/16/15
to nod...@googlegroups.com, fe...@indutny.com
My question is different. Should destroy() be enough already? In the context of the node-imap ticket I linked to. IMHO it should be enough - but the process hangs! Test app: a batch node.js app that connects to an IMAP server (gmail) with deliberately wrong credentials, causing an error on login, causing this line to be executed:


NOTE THAT THIS HAS JUST BEEN PATCHED because of my bug report, using my solution - until an hour ago that line said "destroy()" which left the node.js process hanging. With end() I get my command line back, after all, the node.js app has finished, nothing left to do.

I think it is a bug that destroy() does not work?
Reply all
Reply to author
Forward
0 new messages