                 delegate?.tcp?(session: self, error: error)
             }
             
-            _flags = 0
-            _timer.invalidate()
+            close()
         }
     }
     

            }
        }
        
        if eventCode == .errorOccurred
        {
            if let error = aStream.streamError
            {

    @objc optional func tcp(session:TCPSession, sendEvent:Stream.Event)
    @objc optional func tcp(session:TCPSession, readEvent:Stream.Event)
    @objc optional func tcp(session:TCPSession, error:Error)
    @objc optional func close()
}

extension Stream.Event
