Interface IQuicStream
- Namespace
- VpnHood.Net.Quic.Abstractions
- Assembly
- VpnHood.Net.Quic.Abstractions.dll
Represents the QUIC controls of a server's stream, beside its ordinary Stream operations. The application protocol chooses its error codes; the transport does not interpret them.
public interface IQuicStream
Properties
CanRead
Gets a value indicating whether the stream has an inbound direction.
bool CanRead { get; }
Property Value
CanWrite
Gets a value indicating whether the stream has an outbound direction.
bool CanWrite { get; }
Property Value
ReadsClosed
Gets a task that completes when the inbound direction closes: when the peer's FIN is read, or the direction is aborted.
Task ReadsClosed { get; }
Property Value
StreamId
Gets the stream's QUIC stream ID, whose low two bits tell who opened it and whether it is bidirectional (RFC 9000, section 2.1).
long StreamId { get; }
Property Value
WritesClosed
Gets a task that completes when the outbound direction closes: when the peer acknowledges the FIN, or the direction is aborted.
Task WritesClosed { get; }
Property Value
Methods
AbortRead(long)
Stops receiving data and sends the peer an application error code.
void AbortRead(long errorCode)
Parameters
errorCodelongThe application protocol's error code.
AbortWrite(long)
Stops sending data and sends the peer an application error code.
void AbortWrite(long errorCode)
Parameters
errorCodelongThe application protocol's error code.
CompleteWrites()
Sends FIN after the pending writes, without closing the inbound direction.
void CompleteWrites()
WriteFinal(ReadOnlyMemory<byte>, CancellationToken)
Writes the final bytes and FIN together.
ValueTask WriteFinal(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken)
Parameters
bufferReadOnlyMemory<byte>The bytes. The caller keeps them unchanged until the returned task completes, also after cancellation.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- ValueTask
A task that represents the asynchronous operation.