mediasoup-client-swift icon indicating copy to clipboard operation
mediasoup-client-swift copied to clipboard

Receive Transport Crash on second call

Open lets-swapcode opened this issue 1 year ago • 3 comments

PS - Tried almost everything. Checked discourse group as well.

Case - First time everything works fine, able to leave the call as well BUT when trying to join again then its crashes in the beginning with below error

Screenshot 2023-09-11 at 2 47 28 PM

On leave -

  1. Attempt 1 - Tried setting to nil to all the property (consumer, producer, track, media, device close and nil) and socket disconnect
  2. Attempt 2 - Only socket disconnect
  3. Attempt 3 - consumer close, sent pause consumer socket and socket disconnect

What is the correct way to do this?

Transport callback handling ` func onConnectionStateChange(transport: Transport, connectionState: TransportConnectionState) { LOG.debug("Transport- Reconnect- (transport.id == sendTransport?.id ? "send" : "receive") onConnectionStateChange == (connectionState)")

    qJMMediaBGQueue.async {
        if connectionState == .disconnected && self.isCallEnded{
            LOG.error("Transport- End- transport closed")
            transport.close()
            return
        }
        
        if connectionState == .closed && transport.id == self.sendTransport?.id{
            LOG.error("Transport- End- transport sent closed - stop capture")
            self.videoCapture?.stopCapture()
        }
    }

`

lets-swapcode avatar Sep 11 '23 09:09 lets-swapcode