Example #1
0
        public void DidCreateSessionDescription(RTCPeerConnection peerConnection, RTCSessionDescription sdp, NSError error)
        {
            // dispatch_async(dispatch_get_main_queue(),
            if (error != null)
            {
                System.Diagnostics.Debug.WriteLine($"Failed to create session description. Error: {error}");
                Disconnect();
                //    NSDictionary *userInfo = @{
                //      NSLocalizedDescriptionKey: @"Failed to create session description.",
                //    };
                //    NSError *sdpError =
                //        [[NSError alloc] initWithDomain:kARDAppClientErrorDomain
                //                                   code:kARDAppClientErrorCreateSDP
                //                               userInfo:userInfo];
                _delegate.DidError(this, error);
                return;
            }
            _peerConnection.SetLocalDescriptionWithDelegate(this, sdp);
            ARDSessionDescriptionMessage message = new ARDSessionDescriptionMessage(sdp);

            SendSignalingMessage(message).Wait();
        }