Exemplo n.º 1
0
        private async Task TrySend(ManagementMessage message)
        {
            try
            {
                await _managementChannel.WriteMessage(message);

                _sendingFailed = false;
            }
            catch (IOException ex)
            {
                _sendingFailed = true;
                _logger.Warn($"Sending message \"{message.LogText}\" to OpenVPN management interface failed: {ex.Message}");
            }
        }
 private void Log(ManagementMessage message)
 {
     _logger.Info($"Management <- {message.LogText}");
 }
 public Task WriteMessage(ManagementMessage message)
 {
     Log(message);
     return(_managementChannel.WriteLine(message.ToString()));
 }