APIdia Launch Partner
Top Description Inners Methods
jdk.internal.net.http.quic.streams

public non-sealed Interface QuicReceiverStream

extends QuicStream
Known Direct Subinterfaces
jdk.internal.net.http.quic.streams.QuicBidiStream
Known Direct Implementers
jdk.internal.net.http.quic.streams.QuicReceiverStreamImpl
Imports
jdk.internal.net.http.common.SequentialScheduler

An interface that represents the receiving part of a stream.

From RFC 9000: On the receiving part of a stream, an application protocol can:

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
QuicReceiverStream.ReceivingStreamState

An enum that models the state of the receiving part of a stream.

Method Summary

Modifier and TypeMethod and Description
public QuicStreamReader

Returns:

a QuicStreamReader to read data from this stream.
connectReader
(SequentialScheduler
A sequential scheduler that will be invoked when the reader is started and new data becomes available for reading
scheduler
)

Connects an unstarted reader to the receiver end of this stream.

public long

Returns:

the amount of data that has been received so far
dataReceived
()

Returns the amount of data that has been received so far.

public void
disconnectReader(QuicStreamReader
the reader to be disconnected
reader
)

Disconnect the reader, so that a new reader can be connected.

public default boolean
hasError()

Implements jdk.internal.net.http.quic.streams.QuicStream.hasError.

Returns true if the stream has errors.

public default boolean
public long

Returns:

the maximum amount of data that can be received on this stream
maxStreamData
()

Returns the maximum amount of data that can be received on this stream.

public long

Returns:

the error code for this stream, or -1
rcvErrorCode
()

Returns the error code for this stream, or -1.

public QuicReceiverStream.ReceivingStreamState

Returns:

the receiving state of the stream
receivingState
()

Returns the receiving state of the stream.

public void
requestStopSending(long
the application error code
errorCode
)

Cancels the reading side of this stream by sending a STOP_SENDING frame.

Inherited from jdk.internal.net.http.quic.streams.QuicStream:
isBidirectionalisClientInitiatedisLocalInitiatedisRemoteInitiatedisServerInitiatedmodestatestreamIdtype

Method Detail

connectReaderback to summary
public QuicStreamReader connectReader(SequentialScheduler scheduler)

Connects an unstarted reader to the receiver end of this stream.

Parameters
scheduler:SequentialScheduler

A sequential scheduler that will be invoked when the reader is started and new data becomes available for reading

Returns:QuicStreamReader

a QuicStreamReader to read data from this stream.

Exceptions
IllegalStateException:
if a reader is already connected.
dataReceivedback to summary
public long dataReceived()

Returns the amount of data that has been received so far.

API Note

This may include data that has not been read by the application yet, but does not count any data that may have been received twice.

Returns:long

the amount of data that has been received so far

disconnectReaderback to summary
public void disconnectReader(QuicStreamReader reader)

Disconnect the reader, so that a new reader can be connected.

API Note

This can be useful for handing the stream over after having read or peeked at some bytes.

Parameters
reader:QuicStreamReader

the reader to be disconnected

Exceptions
IllegalStateException:
if the given reader is not currently connected to the stream
hasErrorback to summary
public default boolean hasError()

Implements jdk.internal.net.http.quic.streams.QuicStream.hasError.

Doc from jdk.internal.net.http.quic.streams.QuicStream.hasError.

Returns true if the stream has errors. For a bidirectional stream, this method returns true if either its sending part or its receiving part was closed with a non-zero error code.

Annotations
@Override
isStopSendingRequestedback to summary
public default boolean isStopSendingRequested()
maxStreamDataback to summary
public long maxStreamData()

Returns the maximum amount of data that can be received on this stream.

API Note

This corresponds to the maximum amount of data that the peer has been allowed to send.

Returns:long

the maximum amount of data that can be received on this stream

rcvErrorCodeback to summary
public long rcvErrorCode()

Returns the error code for this stream, or -1.

Returns:long

the error code for this stream, or -1

receivingStateback to summary
public QuicReceiverStream.ReceivingStreamState receivingState()

Returns the receiving state of the stream.

Returns:QuicReceiverStream.ReceivingStreamState

the receiving state of the stream

requestStopSendingback to summary
public void requestStopSending(long errorCode)

Cancels the reading side of this stream by sending a STOP_SENDING frame.

Parameters
errorCode:long

the application error code

jdk.internal.net.http.quic.streams back to summary

public final Enum QuicReceiverStream.ReceivingStreamState

extends Enum<QuicReceiverStream.ReceivingStreamState>
implements StreamState
Class Inheritance
All Implemented Interfaces
jdk.internal.net.http.quic.streams.QuicStream.StreamState

An enum that models the state of the receiving part of a stream.

Field Summary

Modifier and TypeField and Description
public static final QuicReceiverStream.ReceivingStreamState
DATA_READ

The "Data Recvd" state persists until stream data has been delivered to the application.

public static final QuicReceiverStream.ReceivingStreamState
DATA_RECVD

Once all data for the stream has been received, the receiving part enters the "Data Recvd" state.

public static final QuicReceiverStream.ReceivingStreamState
RECV

The initial state for the receiving part of a stream is "Recv".

public static final QuicReceiverStream.ReceivingStreamState
RESET_READ

Once the application receives the signal indicating that the stream was reset, the receiving part of the stream transitions to the "Reset Read" state, which is a terminal state.

public static final QuicReceiverStream.ReceivingStreamState
RESET_RECVD

Receiving a RESET_STREAM frame in the "Recv" or "Size Known" state causes the stream to enter the "Reset Recvd" state.

public static final QuicReceiverStream.ReceivingStreamState
SIZE_KNOWN

When a STREAM frame with a FIN bit is received, the final size of the stream is known; see Section 4.5.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if this state indicates that the stream has been reset by the sender
isReset
()

Returns true if this state indicates that the stream has been reset by the sender.

public boolean
isTerminal()

Implements jdk.internal.net.http.quic.streams.QuicStream.StreamState.isTerminal.

Returns true if this is a terminal state.

public static QuicReceiverStream.ReceivingStreamState
public static QuicReceiverStream.ReceivingStreamState[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DATA_READback to summary
public static final QuicReceiverStream.ReceivingStreamState DATA_READ

The "Data Recvd" state persists until stream data has been delivered to the application. Once stream data has been delivered, the stream enters the "Data Read" state, which is a terminal state.

[RFC 9000, Section 3.1] (https://www.rfc-editor.org/rfc/rfc9000#name-sending-stream-states)

DATA_RECVDback to summary
public static final QuicReceiverStream.ReceivingStreamState DATA_RECVD

Once all data for the stream has been received, the receiving part enters the "Data Recvd" state. This might happen as a result of receiving the same STREAM frame that causes the transition to "Size Known". After all data has been received, any STREAM or STREAM_DATA_BLOCKED frames for the stream can be discarded.

[RFC 9000, Section 3.1] (https://www.rfc-editor.org/rfc/rfc9000#name-sending-stream-states)

RECVback to summary
public static final QuicReceiverStream.ReceivingStreamState RECV

The initial state for the receiving part of a stream is "Recv".

In the "Recv" state, the endpoint receives STREAM and STREAM_DATA_BLOCKED frames. Incoming data is buffered and can be reassembled into the correct order for delivery to the application. As data is consumed by the application and buffer space becomes available, the endpoint sends MAX_STREAM_DATA frames to allow the peer to send more data.

[RFC 9000, Section 3.1] (https://www.rfc-editor.org/rfc/rfc9000#name-sending-stream-states)

RESET_READback to summary
public static final QuicReceiverStream.ReceivingStreamState RESET_READ

Once the application receives the signal indicating that the stream was reset, the receiving part of the stream transitions to the "Reset Read" state, which is a terminal state.

[RFC 9000, Section 3.1] (https://www.rfc-editor.org/rfc/rfc9000#name-sending-stream-states)

RESET_RECVDback to summary
public static final QuicReceiverStream.ReceivingStreamState RESET_RECVD

Receiving a RESET_STREAM frame in the "Recv" or "Size Known" state causes the stream to enter the "Reset Recvd" state. This might cause the delivery of stream data to the application to be interrupted.

[RFC 9000, Section 3.1] (https://www.rfc-editor.org/rfc/rfc9000#name-sending-stream-states)

SIZE_KNOWNback to summary
public static final QuicReceiverStream.ReceivingStreamState SIZE_KNOWN

When a STREAM frame with a FIN bit is received, the final size of the stream is known; see Section 4.5. The receiving part of the stream then enters the "Size Known" state. In this state, the endpoint no longer needs to send MAX_STREAM_DATA frames; it only receives any retransmissions of stream data.

[RFC 9000, Section 3.1] (https://www.rfc-editor.org/rfc/rfc9000#name-sending-stream-states)

Constructor Detail

ReceivingStreamStateback to summary
private ReceivingStreamState()

Method Detail

isResetback to summary
public boolean isReset()

Returns true if this state indicates that the stream has been reset by the sender.

Returns:boolean

true if this state indicates that the stream has been reset by the sender

isTerminalback to summary
public boolean isTerminal()

Implements jdk.internal.net.http.quic.streams.QuicStream.StreamState.isTerminal.

Doc from jdk.internal.net.http.quic.streams.QuicStream.StreamState.isTerminal.

Returns true if this is a terminal state.

Annotations
@Override
valueOfback to summary
public static QuicReceiverStream.ReceivingStreamState valueOf(String name)
valuesback to summary
public static QuicReceiverStream.ReceivingStreamState[] values()