             openAdapter(for: request)
         }
     }
-
+    
     fileprivate func openAdapter(for request: ConnectRequest) {
         guard !isCancelled else {
             return
         }
-
+        
         let manager = RuleManager.currentManager
         let factory = manager.match(request)!
         adapterSocket = factory.getAdapterFor(request: request)
         adapterSocket!.delegate = self
         adapterSocket!.openSocketWith(request: request)
     }
-
+    
     public func didBecomeReadyToForwardWith(socket: SocketProtocol) {
         guard !isCancelled else {
             return
         }
-
+        
         readySignal += 1
         observer?.signal(.receivedReadySignal(socket, currentReady: readySignal, on: self))
-
+        
         defer {
             if let socket = socket as? AdapterSocket {
                 proxySocket.respondTo(adapter: socket)

            return "<Tunnel proxySocket:\(proxySocket)>"
        }
    }

    init(proxySocket: ProxySocket) {
        self.proxySocket = proxySocket
        super.init()
        self.proxySocket.delegate = self

        self.observer = ObserverFactory.currentFactory?.getObserverForTunnel(self)
    }

    /**
     Start running the tunnel.
     */

            }
        }
    }
    
    /// The proxy socket.
    var proxySocket: ProxySocket
    
    /// The adapter socket connecting to remote.
    var adapterSocket: AdapterSocket?
    
    /// The delegate instance.
    weak var delegate: TunnelDelegate?
    
    weak var observer: Observer<TunnelEvent>?
    
    /// Indicating how many socket is ready to forward data.
    private var readySignal = 0
    
    /// If the tunnel is closed, i.e., proxy socket and adapter socket are both disconnected.
    var isClosed: Bool {
        return proxySocket.isDisconnected && (adapterSocket?.isDisconnected ?? true)
    }
    
    fileprivate var _cancelled: Bool = false
    fileprivate var _stopForwarding = false
    public var isCancelled: Bool {
        return _cancelled
    }
    
    fileprivate var _status: TunnelStatus = .invalid
    public var status: TunnelStatus {
        return _status
    }
    
    public var statusDescription: String {
        return status.description
    }
    
    override public var description: String {
        if let adapterSocket = adapterSocket {
            return "<Tunnel proxySocket:\(proxySocket) adapterSocket:\(adapterSocket)>"
