Skip to content

Instantly share code, notes, and snippets.

View TimothyODonnell's full-sized avatar

Tim TimothyODonnell

  • Landmark
  • Devon
View GitHub Profile
using nClam;
using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.EventGrid;
using Microsoft.Extensions.Logging;
using Azure.Storage.Blobs;
using System.IO;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using System.Linq;
// ##### RUN AV ON FILE #####
log.LogInformation("Download completed. Connecting to AV server {ClamAVServerUrl}:{ClamAVServerPort}... ", ClamAVServerUrl, ClamAVServerPort);
var clam = new ClamClient(ClamAVServerUrl, ClamAVServerPort);
bool isConnected = await clam.PingAsync();
var version = await clam.GetVersionAsync();
if (!isConnected) throw new Exception("AV server connection could not be established.");
log.LogInformation("Connection ok: {IsConnected}. AV server reports version: {ServerVersion}", isConnected, version);