     }
 
     override public func readData() {
-        switch internalStatus {
-        case .forwarding:
+        if readIV == nil {
+            socket.readDataTo(length: ivLength)
+        } else {
             super.readData()
-        case .waitingIV:
-            internalStatus = .readingIV
-            socket.readDataTo(length: ivLength)
-        default:
-            return
         }
     }
 

    public let port: Int

    let streamObfuscaterType: ShadowsocksStreamObfuscater.Type

    var readingIV: Bool = false
    var nextReadTag: Int = 0

    var internalStatus: ShadowsocksAdapterStatus = .invalid


    enum ShadowsocksAdapterStatus {
        case invalid,
        connecting,
        sendingIV,
        forwarding,
        stopped
    }
