      */
     open func disconnect() {
         if connection == nil  || connection!.state == .cancelled {
-            delegate?.didDisconnect(self)
+            delegate?.didDisconnectWith(socket: self)
         } else {
             closeAfterWriting = true
             checkStatus()

                return
            }

            self.readCallback(data, tag: tag)
        }
    }



     - throws: Never throws.
     */
    open func connectTo(host: String, port: Int, enableTLS: Bool, tlsSettings: [AnyHashable: Any]?) throws {
        let endpoint = NWHostEndpoint(hostname: host, port: "\(port)")
        let tlsParameters = NWTLSParameters()
        if let tlsSettings = tlsSettings as? [String: AnyObject] {
