{"action":"opened","issue":{"url":"https://api.github.com/repos/node-xmpp/node-xmpp-core/issues/56","labels_url":"https://api.github.com/repos/node-xmpp/node-xmpp-core/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/node-xmpp/node-xmpp-core/issues/56/comments","events_url":"https://api.github.com/repos/node-xmpp/node-xmpp-core/issues/56/events","html_url":"https://github.com/node-xmpp/node-xmpp-core/issues/56","id":57515908,"number":56,"title":"Connection doesn't send </stream:stream> on connection ending","user":{"login":"Retsam","id":2281166,"avatar_url":"https://avatars.githubusercontent.com/u/2281166?v=3","gravatar_id":"","url":"https://api.github.com/users/Retsam","html_url":"https://github.com/Retsam","followers_url":"https://api.github.com/users/Retsam/followers","following_url":"https://api.github.com/users/Retsam/following{/other_user}","gists_url":"https://api.github.com/users/Retsam/gists{/gist_id}","starred_url":"https://api.github.com/users/Retsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Retsam/subscriptions","organizations_url":"https://api.github.com/users/Retsam/orgs","repos_url":"https://api.github.com/users/Retsam/repos","events_url":"https://api.github.com/users/Retsam/events{/privacy}","received_events_url":"https://api.github.com/users/Retsam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-12T20:37:24Z","updated_at":"2015-02-12T20:37:24Z","closed_at":null,"body":"It looks like the Connection should handle the sending of the </stream:stream> stanza when the connection ends.  However, that logic is attached to the `onEnd` handler, which doesn't make sense to me.  If `onEnd` is triggered on the `end` event, then by definition isn't the socket already closed by the time the handler is called?  \r\n\r\nIs sending the `</stream: stream>` message something the consumers of this library need to implement themselves?\r\n\r\nThanks"}}