Interface INetworkChannel
Namespace: Void.Proxy.Api.Network.Channels
Assembly: Void.Proxy.Api.dll
Represents a network channel that manages a pipeline of
public interface INetworkChannel : IDisposable, IAsyncDisposableImplements
Properties
CanRead
Gets a value indicating whether the channel can read messages.
bool CanRead { get; }Property Value
CanWrite
Gets a value indicating whether the channel can write messages.
bool CanWrite { get; }Property Value
Head
Gets the first stream in the channel’s pipeline.
IMessageStreamBase Head { get; }Property Value
IsAlive
Gets a value indicating whether the channel is active.
bool IsAlive { get; }Property Value
IsConfigured
Gets a value indicating whether the channel has been configured.
bool IsConfigured { get; }Property Value
IsPaused
Gets a value indicating whether the channel is currently paused.
bool IsPaused { get; }Property Value
IsPausedRead
Gets a value indicating whether read operations are currently paused.
bool IsPausedRead { get; }Property Value
IsPausedWrite
Gets a value indicating whether write operations are currently paused.
bool IsPausedWrite { get; }Property Value
Methods
Add<T>()
Adds a new stream of type T to the end of the pipeline.
void Add<T>() where T : class, IMessageStream, new()Type Parameters
T
Add<T>(T)
Adds the specified stream to the end of the pipeline.
void Add<T>(T stream) where T : class, IMessageStreamParameters
stream T
Type Parameters
T
AddBefore<TBefore, TValue>()
Inserts a new stream of type TValue before TBefore.
void AddBefore<TBefore, TValue>() where TBefore : class, IMessageStream where TValue : class, IMessageStream, new()Type Parameters
TBefore
TValue
AddBefore<TBefore, TValue>(TValue)
Inserts the specified stream before TBefore.
void AddBefore<TBefore, TValue>(TValue stream) where TBefore : class, IMessageStream where TValue : class, IMessageStreamParameters
stream TValue
Type Parameters
TBefore
TValue
Close()
Closes the channel and releases resources.
void Close()Flush()
Flushes any buffered data.
void Flush()FlushAsync(CancellationToken)
Asynchronously flushes any buffered data.
ValueTask FlushAsync(CancellationToken cancellationToken = default)Parameters
cancellationToken CancellationToken
Returns
Get<T>()
Gets the stream of type T.
T Get<T>() where T : class, IMessageStreamBaseReturns
T
Type Parameters
T
Has<T>()
Determines whether a stream of type T exists in the pipeline.
bool Has<T>() where T : class, IMessageStreamBaseReturns
Type Parameters
T
Pause(Operation)
Pauses channel operations.
void Pause(Operation operation = Operation.Read)Parameters
operation Operation
PrependBuffer(Memory<byte>)
Inserts the given memory at the start of the buffer.
void PrependBuffer(Memory<byte> memory)Parameters
ReadMessageAsync(CancellationToken)
Reads the next message from the channel.
ValueTask<INetworkMessage> ReadMessageAsync(CancellationToken cancellationToken = default)Parameters
cancellationToken CancellationToken
Returns
Remove<T>()
Removes a stream of type T from the pipeline.
void Remove<T>() where T : class, IMessageStreamType Parameters
T
Remove<T>(T)
Removes the specified stream from the pipeline.
void Remove<T>(T stream) where T : class, IMessageStreamParameters
stream T
Type Parameters
T
Resume(Operation)
Resumes channel operations.
void Resume(Operation operation = Operation.Read)Parameters
operation Operation
TryGet<T>(out T)
Attempts to retrieve a stream of type T.
bool TryGet<T>(out T result) where T : class, IMessageStreamBaseParameters
result T
Returns
Type Parameters
T
TryPause(Operation)
Attempts to pause channel operations.
bool TryPause(Operation operation = Operation.Read)Parameters
operation Operation
Returns
TryResume(Operation)
Attempts to resume channel operations.
bool TryResume(Operation operation = Operation.Read)Parameters
operation Operation
Returns
WriteMessageAsync(INetworkMessage, CancellationToken)
Writes the specified message to the channel.
ValueTask WriteMessageAsync(INetworkMessage message, CancellationToken cancellationToken = default)Parameters
message INetworkMessage
cancellationToken CancellationToken