Emit a 'close' event
Emit 'connect' event asynchronously to give a chance for other code to bind event handlers