예제 #1
0
        public string CheckTransmission()
        {
            var isOnline = _telemetryClient.Disconnect();

            int retryLeft = 3;

            while (!isOnline && retryLeft > 0)
            {
                isOnline   = _telemetryClient.Connect(DiagnosticChannelConnectionString);
                retryLeft -= 1;
            }

            if (!isOnline)
            {
                throw new Exception("Unable to connect.");
            }

            _telemetryClient.Send(Channel.DiagnosticMessage);
            return(_telemetryClient.Receive());
        }