         }
     }
 
+    private func terminateAllStreams() {
+        for stream in streams {
+            stream.terminate()
+        }
+        streams.removeAll()
+        // Do not call `handlers.onRemoveStreamHandler` here
+        // This method is meant to be called only when disconnection cleanup
+    }
+
     private func createAnswer(isSender: Bool,
-                      offer: String,
-                      constraints: RTCMediaConstraints,
-                      handler: @escaping (String?, Error?) -> Void)
+                              offer: String,
+                              constraints: RTCMediaConstraints,
+                              handler: @escaping (String?, Error?) -> Void)
     {
         Logger.debug(type: .peerChannel, message: "try create answer")
         Logger.debug(type: .peerChannel, message: offer)

    // type: redirect のために SDP を保存しておく
    // 値が設定されている場合2回目の type: connect メッセージ送信とみなし、 redirect 中であると判断する
    private var sdp: String?
    
    func connect(handler: @escaping (Error?) -> Void) {
        if state == .connecting || state == .connected {
            handler(SoraError.connectionBusy(reason:

        }
    }

    // MARK: - Properties

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