Class SodiumEncryptStream
Encrypts an RTP frame using libsodium.
public class SodiumEncryptStream : AudioOutStream, IAsyncDisposable, IDisposable
- Inheritance
-
SodiumEncryptStream
- Implements
- Inherited Members
Constructors
SodiumEncryptStream(AudioStream, IAudioClient)
public SodiumEncryptStream(AudioStream next, IAudioClient client)
Parameters
next
AudioStreamclient
IAudioClient
Methods
ClearAsync(CancellationToken)
public override Task ClearAsync(CancellationToken cancelToken)
Parameters
cancelToken
CancellationToken
Returns
Dispose(bool)
Releases the unmanaged resources used by the Stream and optionally releases the managed resources.
protected override void Dispose(bool disposing)
Parameters
disposing
booltrue to release both managed and unmanaged resources; false to release only unmanaged resources.
FlushAsync(CancellationToken)
Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests.
public override Task FlushAsync(CancellationToken cancelToken)
Parameters
cancelToken
CancellationToken
Returns
- Task
A task that represents the asynchronous flush operation.
Exceptions
- ObjectDisposedException
The stream has been disposed.
- OperationCanceledException
The cancellation token was canceled. This exception is stored into the returned task.
WriteAsync(byte[], int, int, CancellationToken)
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancelToken)
Parameters
buffer
byte[]offset
intcount
intcancelToken
CancellationToken
Returns
Exceptions
- InvalidOperationException
Received payload without an RTP header.
- OperationCanceledException
The token has had cancellation requested.
- ObjectDisposedException
The associated CancellationTokenSource has been disposed.
WriteHeader(ushort, uint, bool)
public override void WriteHeader(ushort seq, uint timestamp, bool missed)
Parameters
Exceptions
- InvalidOperationException
Header received with no payload.