     // type: redirect のために SDP を保存しておく
     // 値が設定されている場合2回目の type: connect メッセージ送信とみなし、 redirect 中であると判断する
     private var sdp: String?
-    
+
+    // MARK: - Public methods
+
+    required init(configuration: Configuration, signalingChannel: SignalingChannel, mediaChannel: MediaChannel?) {
+        self.signalingChannel = signalingChannel
+        self.mediaChannel = mediaChannel
+        self.configuration = configuration
+        webRTCConfiguration = configuration.webRTCConfiguration
+
+        lock = Lock()
+        super.init()
+        lock.context = self
+
+        signalingChannel.internalHandlers.onDisconnect = { [weak self] error, reason in
+            self?.disconnect(error: error, reason: reason)
+        }
+
+        signalingChannel.internalHandlers.onReceive = { [weak self] signaling in
+            self?.handle(signaling: signaling)
+        }
+    }
+
     func connect(handler: @escaping (Error?) -> Void) {
         if state == .connecting || state == .connected {
             handler(SoraError.connectionBusy(reason:

        }
    }

    private func createAnswer(isSender: Bool,
                      offer: String,
                      constraints: RTCMediaConstraints,
                      handler: @escaping (String?, Error?) -> Void)
    {
        Logger.debug(type: .peerChannel, message: "try create answer")
        Logger.debug(type: .peerChannel, message: offer)

        }
    }

    // MARK: - Properties

    var internalHandlers = PeerChannelInternalHandlers()
    let configuration: Configuration
    let signalingChannel: SignalingChannel
