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

public non-sealed Interface QuicSenderStream

extends QuicStream
Known Direct Subinterfaces
jdk.internal.net.http.quic.streams.QuicBidiStream
Known Direct Implementers
jdk.internal.net.http.quic.streams.QuicSenderStreamImpl
Imports
java.io.IOException, jdk.internal.net.http.common.SequentialScheduler

An interface that represents the sending part of a stream.

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
QuicSenderStream.SendingStreamState

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

Method Summary

Modifier and TypeMethod and Description
public QuicStreamWriter

Returns:

a QuicStreamWriter to write data to this stream.
connectWriter
(SequentialScheduler
A sequential scheduler that will push data on the returned writer.
scheduler
)

Connects a writer to the sending end of this stream.

public long

Returns:

the amount of data that has been sent
dataSent
()

Returns the amount of data that has been sent.

public void
disconnectWriter(QuicStreamWriter
the writer to be disconnected
writer
)

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

public default boolean
hasError()

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

Returns true if the stream has errors.

public void
reset(long
the application error code
errorCode
)

Abruptly closes the writing side of a stream by sending a RESET_STREAM frame.

public QuicSenderStream.SendingStreamState

Returns:

the sending state of the stream
sendingState
()

Returns the sending state of the stream.

public long

Returns:

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

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

public boolean

Returns:

true if STOP_SENDING was received
stopSendingReceived
()

Returns true if STOP_SENDING was received.

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

Method Detail

connectWriterback to summary
public QuicStreamWriter connectWriter(SequentialScheduler scheduler)

Connects a writer to the sending end of this stream.

Parameters
scheduler:SequentialScheduler

A sequential scheduler that will push data on the returned writer.

Returns:QuicStreamWriter

a QuicStreamWriter to write data to this stream.

Exceptions
IllegalStateException:
if a writer is already connected.
dataSentback to summary
public long dataSent()

Returns the amount of data that has been sent.

API Note

This may include data that has not been acknowledged.

Returns:long

the amount of data that has been sent

disconnectWriterback to summary
public void disconnectWriter(QuicStreamWriter writer)

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

API Note

This can be useful for handing the stream over after having written some bytes.

Parameters
writer:QuicStreamWriter

the writer to be disconnected

Exceptions
IllegalStateException:
if the given writer 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
resetback to summary
public void reset(long errorCode) throws IOException

Abruptly closes the writing side of a stream by sending a RESET_STREAM frame.

Parameters
errorCode:long

the application error code

sendingStateback to summary
public QuicSenderStream.SendingStreamState sendingState()

Returns the sending state of the stream.

Returns:QuicSenderStream.SendingStreamState

the sending state of the stream

sndErrorCodeback to summary
public long sndErrorCode()

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

Returns:long

the error code for this stream, or -1

stopSendingReceivedback to summary
public boolean stopSendingReceived()

Returns true if STOP_SENDING was received.

Returns:boolean

true if STOP_SENDING was received

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

public final Enum QuicSenderStream.SendingStreamState

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

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

Field Summary

Modifier and TypeField and Description
public static final QuicSenderStream.SendingStreamState
DATA_RECVD

Once all stream data has been successfully acknowledged, the sending part of the stream enters the "Data Recvd" state, which is a terminal state.

public static final QuicSenderStream.SendingStreamState
DATA_SENT

After the application indicates that all stream data has been sent and a STREAM frame containing the FIN bit is sent, the sending part of the stream enters the "Data Sent" state.

public static final QuicSenderStream.SendingStreamState
READY

The "Ready" state represents a newly created stream that is able to accept data from the application.

public static final QuicSenderStream.SendingStreamState
RESET_RECVD

Once a packet containing a RESET_STREAM has been acknowledged, the sending part of the stream enters the "Reset Recvd" state, which is a terminal state.

public static final QuicSenderStream.SendingStreamState
RESET_SENT

From any state that is one of "Ready", "Send", or "Data Sent", an application can signal that it wishes to abandon transmission of stream data.

public static final QuicSenderStream.SendingStreamState
SEND

In the "Send" state, an endpoint transmits -- and retransmits as necessary -- stream data in STREAM frames.

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

Returns:

true if a stream in this state can be used for sending, that is, if this state is either READY or SEND
isSending
()

Returns true if a stream in this state can be used for sending, that is, if this state is either READY or SEND.

public boolean
isTerminal()

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

Returns true if this is a terminal state.

public static QuicSenderStream.SendingStreamState
public static QuicSenderStream.SendingStreamState[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DATA_RECVDback to summary
public static final QuicSenderStream.SendingStreamState DATA_RECVD

Once all stream data has been successfully acknowledged, the sending part of the stream enters the "Data Recvd" state, which is a terminal state.

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

DATA_SENTback to summary
public static final QuicSenderStream.SendingStreamState DATA_SENT

After the application indicates that all stream data has been sent and a STREAM frame containing the FIN bit is sent, the sending part of the stream enters the "Data Sent" state. From this state, the endpoint only retransmits stream data as necessary. The endpoint does not need to check flow control limits or send STREAM_DATA_BLOCKED frames for a stream in this state. MAX_STREAM_DATA frames might be received until the peer receives the final stream offset. The endpoint can safely ignore any MAX_STREAM_DATA frames it receives from its peer for a stream in this state.

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

READYback to summary
public static final QuicSenderStream.SendingStreamState READY

The "Ready" state represents a newly created stream that is able to accept data from the application. Stream data might be buffered in this state in preparation for sending.

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

RESET_RECVDback to summary
public static final QuicSenderStream.SendingStreamState RESET_RECVD

Once a packet containing a RESET_STREAM has been acknowledged, the sending part of the stream enters the "Reset Recvd" state, which is a terminal state.

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

RESET_SENTback to summary
public static final QuicSenderStream.SendingStreamState RESET_SENT

From any state that is one of "Ready", "Send", or "Data Sent", an application can signal that it wishes to abandon transmission of stream data. Alternatively, an endpoint might receive a STOP_SENDING frame from its peer. In either case, the endpoint sends a RESET_STREAM frame, which causes the stream to enter the "Reset Sent" state.

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

SENDback to summary
public static final QuicSenderStream.SendingStreamState SEND

In the "Send" state, an endpoint transmits -- and retransmits as necessary -- stream data in STREAM frames. The endpoint respects the flow control limits set by its peer and continues to accept and process MAX_STREAM_DATA frames. An endpoint in the "Send" state generates STREAM_DATA_BLOCKED frames if it is blocked from sending by stream flow control limits (Section 4.1).

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

Constructor Detail

SendingStreamStateback to summary
private SendingStreamState()

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

isSendingback to summary
public boolean isSending()

Returns true if a stream in this state can be used for sending, that is, if this state is either READY or SEND. .

Returns:boolean

true if a stream in this state can be used for sending, that is, if this state is either READY or SEND

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 QuicSenderStream.SendingStreamState valueOf(String name)
valuesback to summary
public static QuicSenderStream.SendingStreamState[] values()