import Foundation

/// The base class of adapter factory.
open class AdapterFactory {
    public init() {}
    
    /**
     Build an adapter.

     - parameter session: The connect session.

     - returns: The built adapter.
     */
    open func getAdapterFor(session: ConnectSession) -> AdapterSocket {
        return getDirectAdapter()
    }

    /**
     Helper method to get a `DirectAdapter`.

     - returns: A direct adapter.
     */
    public func getDirectAdapter() -> AdapterSocket {
        let adapter = DirectAdapter()
        adapter.socket = RawSocketFactory.getRawSocket()
        return adapter
    }
}

/// Factory building direct adapters.
///
/// - note: This is needed since we need to identify direct adapter factory.
public class DirectAdapterFactory: AdapterFactory {
    public override init() {}
}

import Foundation

/// The base class of adapter factory.
open class AdapterFactory {
    public init() {}
    
    /**
     Build an adapter.

     - parameter session: The connect session.

     - returns: The built adapter.
     */
    public func getAdapterFor(session: ConnectSession) -> AdapterSocket {
        return getDirectAdapter()
    }

    /**
     Helper method to get a `DirectAdapter`.

     - returns: A direct adapter.
     */
    func getDirectAdapter() -> AdapterSocket {
        let adapter = DirectAdapter()
        adapter.socket = RawSocketFactory.getRawSocket()
        return adapter
    }
}

/// Factory building direct adapters.
///
/// - note: This is needed since we need to identify direct adapter factory.
public class DirectAdapterFactory: AdapterFactory {
    public override init() {}
}

--- 
+++ 
@@ -11,7 +11,7 @@
 
      - returns: The built adapter.
      */
-    public func getAdapterFor(session: ConnectSession) -> AdapterSocket {
+    open func getAdapterFor(session: ConnectSession) -> AdapterSocket {
         return getDirectAdapter()
     }
 
@@ -20,7 +20,7 @@
 
      - returns: A direct adapter.
      */
-    func getDirectAdapter() -> AdapterSocket {
+    public func getDirectAdapter() -> AdapterSocket {
         let adapter = DirectAdapter()
         adapter.socket = RawSocketFactory.getRawSocket()
         return adapter
Mark some method `open` and `public`.