Class SrtFileSender
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
EndPoint
Gets remote end point info.
public IPProtoEndPoint EndPoint { get; }
Property Value
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
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
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
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
InstanceId
Gets or sets unique instance id of the object
public Guid InstanceId { get; set; }
Property Value
IsDisposed
Can be used to check whether object is already disposed and can't be used anymore
public bool IsDisposed { get; }
Property Value
RefCount
Gets current reference count of the object
public int RefCount { get; }
Property Value
State
Gets current file transfer state
public MediaState State { get; }
Property Value
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
Uri
Gets or sets server URI.
public string Uri { get; set; }
Property Value
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
cancellationTokenCancellationToken?An optional cancellation token to cancel the transfer.
Returns
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