astro/node-xmpp — pull request #121 by dhable (2013-06-05 17:12:52+00:00)
Title: Fixing TLS Behavior For Server Code

In building a XMPP server for client connections using the C2SServer class, we noticed that the scoping of this in the setSecure method wasn't correctly referencing the right object. As the code is currently structured, connecting a client to the server would result in a runtime exception.

Additionally, there was a behavior we noticed when TLS is enabled and connected to our C# client where the socket doesn't emit a close event but rather an end event. While the end is being handled, the Connection class in the node-xmpp client doesn't emit anything. We added code to emit an end event. This makes the Connection object follow the same pattern as the net.Socket class and provides us the correct hooks for detecting when TLS clients fall offline.