Made connection callback a param of connect to resolve TLS connect event being different to net.Socket connect event.