Table of Contents

Interface IFileTransfer

Namespace
VAST.Media
Assembly
VAST.Common.dll

Defines the contract for file transfer operations including receiving and sending files.

public interface IFileTransfer : IReferenceable, IDisposable
Inherited Members

Properties

Direction

Gets the data flow direction (sending or receiving).

MediaFlowDirection Direction { get; }

Property Value

MediaFlowDirection

EndPoint

Gets the remote endpoint information.

IPProtoEndPoint EndPoint { get; }

Property Value

IPProtoEndPoint

ErrorDescription

Gets the error description. Only meaningful if ExecuteAsync(CancellationToken?) returned false or the state is Error.

string ErrorDescription { get; }

Property Value

string

FileCreatedAt

Gets or sets the file creation date and time. For receivers, this exposes the received file's creation date when present. For senders, this can be used to set the creation date when a user-defined stream is specified; otherwise ignored.

DateTime? FileCreatedAt { get; set; }

Property Value

DateTime?

FileModifiedAt

Gets or sets the file modification date and time. For receivers, this exposes the received file's modification date when present. For senders, this can be used to set the modification date when a user-defined stream is specified; otherwise ignored.

DateTime? FileModifiedAt { get; set; }

Property Value

DateTime?

FilePath

Gets or sets the local file path to read from or write to. Either FilePath or Stream must be set, but not both.

string FilePath { get; set; }

Property Value

string

InstanceId

Gets or sets the unique identifier for this transfer instance.

Guid InstanceId { get; set; }

Property Value

Guid

State

Gets the current file transfer state.

MediaState State { get; }

Property Value

MediaState

Stream

Gets or sets the stream to read from or write to. Either FilePath or Stream must be set, but not both.

Stream Stream { get; set; }

Property Value

Stream

Uri

Gets or sets the server URI for the file transfer.

string Uri { get; set; }

Property Value

string

Methods

ExecuteAsync(CancellationToken?)

Executes the file transfer asynchronously.

Task<bool> ExecuteAsync(CancellationToken? cancellationToken = null)

Parameters

cancellationToken CancellationToken?

An optional cancellation token to cancel the transfer.

Returns

Task<bool>

A task that returns true if the transfer completed successfully; otherwise, false. In case of an error, the detailed description is available in the ErrorDescription property.

Events

StateChanged

Occurs when the transfer state changes.

event EventHandler<MediaState> StateChanged

Event Type

EventHandler<MediaState>