C# Класс nClam.ClamClient

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ClamClient ( string server, int port = 3310 ) : System

A class to connect to a ClamAV server and request virus scans

GetVersionAsync ( ) : Task

Gets the ClamAV server version

GetVersionAsync ( CancellationToken cancellationToken ) : Task

Gets the ClamAV server version

PingAsync ( ) : Task

Executes a PING command on the ClamAV server.

PingAsync ( CancellationToken cancellationToken ) : Task

Executes a PING command on the ClamAV server.

ScanFileOnServerAsync ( string filePath ) : Task

Scans a file/directory on the ClamAV Server.

ScanFileOnServerAsync ( string filePath, CancellationToken cancellationToken ) : Task

Scans a file/directory on the ClamAV Server.

ScanFileOnServerMultithreadedAsync ( string filePath ) : Task

Scans a file/directory on the ClamAV Server using multiple threads on the server.

ScanFileOnServerMultithreadedAsync ( string filePath, CancellationToken cancellationToken ) : Task

Scans a file/directory on the ClamAV Server using multiple threads on the server.

SendAndScanFileAsync ( Stream sourceStream ) : Task

Sends the data to the ClamAV server as a stream.

SendAndScanFileAsync ( Stream sourceStream, CancellationToken cancellationToken ) : Task

Sends the data to the ClamAV server as a stream.

SendAndScanFileAsync ( byte fileData ) : Task

Sends the data to the ClamAV server as a stream.

SendAndScanFileAsync ( byte fileData, CancellationToken cancellationToken ) : Task

Sends the data to the ClamAV server as a stream.

SendAndScanFileAsync ( string filePath ) : Task

Reads the file from the path and then sends it to the ClamAV server as a stream.

SendAndScanFileAsync ( string filePath, CancellationToken cancellationToken ) : Task

Reads the file from the path and then sends it to the ClamAV server as a stream.

Приватные методы

Метод Описание
ExecuteClamCommandAsync ( string command, CancellationToken cancellationToken, Func additionalCommand = null ) : Task

Helper method which connects to the ClamAV Server, performs the command and returns the result.

SendStreamFileChunksAsync ( Stream sourceStream, Stream clamStream, CancellationToken cancellationToken ) : Task

Helper method to send a byte array over the wire to the ClamAV server, split up in chunks.

Описание методов

ClamClient() публичный Метод

A class to connect to a ClamAV server and request virus scans
public ClamClient ( string server, int port = 3310 ) : System
server string Address to the ClamAV server
port int Port which the ClamAV server is listening on
Результат System

GetVersionAsync() публичный Метод

Gets the ClamAV server version
public GetVersionAsync ( ) : Task
Результат Task

GetVersionAsync() публичный Метод

Gets the ClamAV server version
public GetVersionAsync ( CancellationToken cancellationToken ) : Task
cancellationToken CancellationToken
Результат Task

PingAsync() публичный Метод

Executes a PING command on the ClamAV server.
public PingAsync ( ) : Task
Результат Task

PingAsync() публичный Метод

Executes a PING command on the ClamAV server.
public PingAsync ( CancellationToken cancellationToken ) : Task
cancellationToken CancellationToken
Результат Task

ScanFileOnServerAsync() публичный Метод

Scans a file/directory on the ClamAV Server.
public ScanFileOnServerAsync ( string filePath ) : Task
filePath string Path to the file/directory on the ClamAV server.
Результат Task

ScanFileOnServerAsync() публичный Метод

Scans a file/directory on the ClamAV Server.
public ScanFileOnServerAsync ( string filePath, CancellationToken cancellationToken ) : Task
filePath string Path to the file/directory on the ClamAV server.
cancellationToken CancellationToken cancellation token used for request
Результат Task

ScanFileOnServerMultithreadedAsync() публичный Метод

Scans a file/directory on the ClamAV Server using multiple threads on the server.
public ScanFileOnServerMultithreadedAsync ( string filePath ) : Task
filePath string Path to the file/directory on the ClamAV server.
Результат Task

ScanFileOnServerMultithreadedAsync() публичный Метод

Scans a file/directory on the ClamAV Server using multiple threads on the server.
public ScanFileOnServerMultithreadedAsync ( string filePath, CancellationToken cancellationToken ) : Task
filePath string Path to the file/directory on the ClamAV server.
cancellationToken CancellationToken cancellation token used for request
Результат Task

SendAndScanFileAsync() публичный Метод

Sends the data to the ClamAV server as a stream.
public SendAndScanFileAsync ( Stream sourceStream ) : Task
sourceStream Stream Stream containing the data to scan.
Результат Task

SendAndScanFileAsync() публичный Метод

Sends the data to the ClamAV server as a stream.
public SendAndScanFileAsync ( Stream sourceStream, CancellationToken cancellationToken ) : Task
sourceStream Stream Stream containing the data to scan.
cancellationToken CancellationToken cancellation token used for request
Результат Task

SendAndScanFileAsync() публичный Метод

Sends the data to the ClamAV server as a stream.
public SendAndScanFileAsync ( byte fileData ) : Task
fileData byte Byte array containing the data from a file.
Результат Task

SendAndScanFileAsync() публичный Метод

Sends the data to the ClamAV server as a stream.
public SendAndScanFileAsync ( byte fileData, CancellationToken cancellationToken ) : Task
fileData byte Byte array containing the data from a file.
cancellationToken CancellationToken cancellation token used for request
Результат Task

SendAndScanFileAsync() публичный Метод

Reads the file from the path and then sends it to the ClamAV server as a stream.
public SendAndScanFileAsync ( string filePath ) : Task
filePath string Path to the file/directory.
Результат Task

SendAndScanFileAsync() публичный Метод

Reads the file from the path and then sends it to the ClamAV server as a stream.
public SendAndScanFileAsync ( string filePath, CancellationToken cancellationToken ) : Task
filePath string Path to the file/directory.
cancellationToken CancellationToken cancellation token used for request
Результат Task