{"action":"created","issue":{"url":"https://api.github.com/repos/mscdex/ssh2/issues/217","labels_url":"https://api.github.com/repos/mscdex/ssh2/issues/217/labels{/name}","comments_url":"https://api.github.com/repos/mscdex/ssh2/issues/217/comments","events_url":"https://api.github.com/repos/mscdex/ssh2/issues/217/events","html_url":"https://github.com/mscdex/ssh2/issues/217","id":54719889,"number":217,"title":"Socket unref","user":{"login":"xxorax","id":205049,"avatar_url":"https://avatars.githubusercontent.com/u/205049?v=3","gravatar_id":"","url":"https://api.github.com/users/xxorax","html_url":"https://github.com/xxorax","followers_url":"https://api.github.com/users/xxorax/followers","following_url":"https://api.github.com/users/xxorax/following{/other_user}","gists_url":"https://api.github.com/users/xxorax/gists{/gist_id}","starred_url":"https://api.github.com/users/xxorax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xxorax/subscriptions","organizations_url":"https://api.github.com/users/xxorax/orgs","repos_url":"https://api.github.com/users/xxorax/repos","events_url":"https://api.github.com/users/xxorax/events{/privacy}","received_events_url":"https://api.github.com/users/xxorax/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-19T02:10:32Z","updated_at":"2015-01-19T02:50:40Z","closed_at":"2015-01-19T02:50:40Z","body":"I try to call [unref](http://nodejs.org/api/net.html#net_socket_unref) on the socket, to allow the process exit without waiting the end of the socket.\r\nSo I try to do in the \"ready\" event (where the socket is initialised) :\r\n```\r\nconn.once('ready', function () {\r\n  conn._sock.unref();\r\n```\r\nBut it seems not work... (I'm on node v0.10.35)\r\n\r\nIs there other socket I should care ?\r\nOr Is it possible you implement an option for this ?\r\n\r\nThanks !"},"comment":{"url":"https://api.github.com/repos/mscdex/ssh2/issues/comments/70440607","html_url":"https://github.com/mscdex/ssh2/issues/217#issuecomment-70440607","issue_url":"https://api.github.com/repos/mscdex/ssh2/issues/217","id":70440607,"user":{"login":"mscdex","id":54666,"avatar_url":"https://avatars.githubusercontent.com/u/54666?v=3","gravatar_id":"","url":"https://api.github.com/users/mscdex","html_url":"https://github.com/mscdex","followers_url":"https://api.github.com/users/mscdex/followers","following_url":"https://api.github.com/users/mscdex/following{/other_user}","gists_url":"https://api.github.com/users/mscdex/gists{/gist_id}","starred_url":"https://api.github.com/users/mscdex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mscdex/subscriptions","organizations_url":"https://api.github.com/users/mscdex/orgs","repos_url":"https://api.github.com/users/mscdex/repos","events_url":"https://api.github.com/users/mscdex/events{/privacy}","received_events_url":"https://api.github.com/users/mscdex/received_events","type":"User","site_admin":false},"created_at":"2015-01-19T02:50:40Z","updated_at":"2015-01-19T02:50:40Z","body":"The reason is that by default in ssh2 v0.3.x, there is a ping interval that is set up. You can disable this by setting `pingInterval: false` in your config options. Or if you want to dig into the internals to disable the timer manually, you can do `clearInterval(conn._pinger);`.\r\n\r\nIn ssh2 v0.4.x, the keepalive timer is not on by default so `unref()`'ing the socket is enough."}}