Table of Contents

Class SrtFileSender

Namespace
VAST.SRT
Assembly
VAST.SRT.dll

Sends files over SRT protocol to a remote receiver.

public class SrtFileSender : IFileTransfer, IReferenceable, IDisposable
Inheritance
SrtFileSender
Implements
Inherited Members

Constructors

SrtFileSender()

Initializes a new instance of the SrtFileSender class.

public SrtFileSender()

Properties

Direction

Gets data flow direction.

public MediaFlowDirection Direction { get; }

Property Value

MediaFlowDirection

EndPoint

Gets remote end point info.

public IPProtoEndPoint EndPoint { get; }

Property Value

IPProtoEndPoint

ErrorDescription

Gets error description. Only makes sense if the ExecuteAsync methods returned false of the state is MediaState.Error.

public string ErrorDescription { get; }

Property Value

string

FileCreatedAt

Gets or sets file creation date/time. Can be used to set file creation date/time when user defined stream is specified, otherwise ignored.

public DateTime? FileCreatedAt { get; set; }

Property Value

DateTime?

FileModifiedAt

Gets or sets file modification date/time. Can be used to set file modification date/time when user defined stream is specified, otherwise ignored.

public DateTime? FileModifiedAt { get; set; }

Property Value

DateTime?

FilePath

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

public string FilePath { get; set; }

Property Value

string

InstanceId

Gets or sets unique instance id of the object

public Guid InstanceId { get; set; }

Property Value

Guid

IsDisposed

Can be used to check whether object is already disposed and can't be used anymore

public bool IsDisposed { get; }

Property Value

bool

RefCount

Gets current reference count of the object

public int RefCount { get; }

Property Value

int

State

Gets current file transfer state

public MediaState State { get; }

Property Value

MediaState

Stream

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

public Stream Stream { get; set; }

Property Value

Stream

Uri

Gets or sets server URI.

public string Uri { get; set; }

Property Value

string

Methods

AddRef()

Add reference

public void AddRef()

Dispose()

Releases all resources used by the SrtFileSender class.

public void Dispose()

ExecuteAsync(CancellationToken?)

Executes the file transfer asynchronously and returns when completed or errored.

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

Parameters

cancellationToken CancellationToken?

An optional cancellation token to cancel the transfer.

Returns

Task<bool>

A task that resolves to true if the transfer was successful; otherwise, false.

Release()

Release reference. If reference count becomes 0 then Dispose() method is called. Calling object must not use current object after this call.

public void Release()

Events

StateChanged

Occurs when the file transfer state changes.

public event EventHandler<MediaState> StateChanged

Event Type

EventHandler<MediaState>