     private var remainWriteLength: Int = 0
     private var closeAfterWriting = false
 
+    private var scanner: StreamScanner?
+
+    private var readLength: Int?
+
     /**
      Initailize an instance with `TSTCPSocket`.
 

     The socket will disconnect elegantly after any queued writing data are successfully sent.
     */
    func disconnect() {
        self.closeAfterWriting = true
        self.checkStatus()
    }

    /**
     Disconnect the socket immediately.
     */
    func forceDisconnect() {
        self.tsSocket.close()
    }

    /**

     - warning: This should only be called after the last read is finished, i.e., `delegate?.didReadData()` is called.
     */
    func readDataWithTag(tag: Int) {
        readTag = tag
        checkReadData()
    }

    /**
