C# Class nClam.ClamClient

Afficher le fichier Open project: tekmaven/nClam Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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.

Method Details

ClamClient() public méthode

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
Résultat System

GetVersionAsync() public méthode

Gets the ClamAV server version
public GetVersionAsync ( ) : Task
Résultat Task

GetVersionAsync() public méthode

Gets the ClamAV server version
public GetVersionAsync ( CancellationToken cancellationToken ) : Task
cancellationToken CancellationToken
Résultat Task

PingAsync() public méthode

Executes a PING command on the ClamAV server.
public PingAsync ( ) : Task
Résultat Task

PingAsync() public méthode

Executes a PING command on the ClamAV server.
public PingAsync ( CancellationToken cancellationToken ) : Task
cancellationToken CancellationToken
Résultat Task

ScanFileOnServerAsync() public méthode

Scans a file/directory on the ClamAV Server.
public ScanFileOnServerAsync ( string filePath ) : Task
filePath string Path to the file/directory on the ClamAV server.
Résultat Task

ScanFileOnServerAsync() public méthode

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
Résultat Task

ScanFileOnServerMultithreadedAsync() public méthode

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.
Résultat Task

ScanFileOnServerMultithreadedAsync() public méthode

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
Résultat Task

SendAndScanFileAsync() public méthode

Sends the data to the ClamAV server as a stream.
public SendAndScanFileAsync ( Stream sourceStream ) : Task
sourceStream Stream Stream containing the data to scan.
Résultat Task

SendAndScanFileAsync() public méthode

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
Résultat Task

SendAndScanFileAsync() public méthode

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.
Résultat Task

SendAndScanFileAsync() public méthode

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
Résultat Task

SendAndScanFileAsync() public méthode

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.
Résultat Task

SendAndScanFileAsync() public méthode

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
Résultat Task