示例#1
0
        private void SignalingParametersReady(SignalingParameters signalingParameters)
        {
            _logger.Debug(TAG, "Room connection completed.");

            if (_connectionParameters.IsLoopback &&
                (!signalingParameters.IsInitiator || signalingParameters.OfferSdp != null))
            {
                ReportError("Loopback room is busy.");
                return;
            }

            if (!_connectionParameters.IsLoopback && !signalingParameters.IsInitiator &&
                signalingParameters.OfferSdp == null)
            {
                _logger.Warning(TAG, "No offer SDP in room response.");
            }

            _initiator  = signalingParameters.IsInitiator;
            _messageUrl = GetMessageUrl(_connectionParameters, signalingParameters);
            _leaveUrl   = GetLeaveUrl(_connectionParameters, signalingParameters);

            _logger.Debug(TAG, $"Message URL: {_messageUrl}");
            _logger.Debug(TAG, $"Leave URL: {_leaveUrl}");

            State = ConnectionState.Connected;

            _signalingEvents.OnChannelConnected(signalingParameters);

            _wsClient.Connect(signalingParameters.WssUrl, signalingParameters.WssPostUrl);
            _wsClient.Register(_connectionParameters.RoomId, signalingParameters.ClientId);
        }
        private void SignalingParametersReady(RegisteredMessage registeredMessage)
        {
            _logger.Debug(TAG, "Connection completed.");

            if (registeredMessage.SocketId == null)
            {
                ReportError("Failed to register with WS");
                return;
            }

            _socketId = registeredMessage.SocketId;

            State = ConnectionState.Connected;

            _signalingEvents.OnChannelConnected(registeredMessage);
        }
        private void SignalingParametersReady(SignalingParameters _roomSignalingParameters)
        {
            logger.Debug(TAG, "Room connection completed.");

            if (roomConnectionParameters.IsLoopback &&
                (!_roomSignalingParameters.IsInitiator || _roomSignalingParameters.OfferSdp != null))
            {
                ReportError("Loopback room is busy.");
                return;
            }

            if (!roomConnectionParameters.IsLoopback && !_roomSignalingParameters.IsInitiator &&
                _roomSignalingParameters.OfferSdp == null)
            {
                logger.Warning(TAG, "No offer SDP in room response.");
            }

            isInitiator = _roomSignalingParameters.IsInitiator;
            signalingEvents.OnChannelConnected(_roomSignalingParameters);
        }