Esempio n. 1
0
        public void ConnectData(IPEndPoint endpoint)
        {
            _requestStop = false;
            Endpoint     = endpoint;
            _logger.Info($"{LogClientId}| Starting SRS Data Connection");
            IsDataConnected = SrsDataClient.Connect(endpoint);

            if (IsDataConnected)
            {
                _clientSyncThread = new Thread(SrsDataClient.ClientSyncLoop)
                {
                    Name = $"{LogClientId} Client Sync Loop"
                };
                _clientSyncThread.Start();
                ConnectAudio();
                AudioManager.StartEncoding();
                SrsDataClient.ConnectExternalAwacsMode();
                Thread.Sleep(10000);
                _connectionMonitorTimer.Start();
            }
            else
            {
                _logger.Info($"{LogClientId}| SRS Data Connection failed");
                Reconnect();
            }
        }
Esempio n. 2
0
        private void DataConnectedCallback(bool result)
        {
            if (result)
            {
                if (IsDataConnected)
                {
                    return;
                }

                IsDataConnected = true;
                ConnectAudio();
                AudioManager.StartEncoding();
                SrsDataClient.ConnectExternalAwacsMode();
            }
            else
            {
                Disconnect();
                Thread.Sleep(5000);
                _logger.Debug($"{LogClientId}| Could not connect to SRS server. Trying again");
                ConnectData(Endpoint);
            }
        }