-
public final class Http2StreamA logical bidirectional stream.
-
-
Field Summary
Fields Modifier and Type Field Description final intidfinal Http2Connectionconnectionprivate final List<Header>requestHeadersErrorCodeerrorCode
-
Method Summary
Modifier and Type Method Description intgetId()Http2ConnectiongetConnection()List<Header>getRequestHeaders()synchronized ErrorCodegetErrorCode()Returns the reason why this stream was closed, or null if it closed normally or has not yetbeen closed. synchronized booleanisOpen()Returns true if this stream is open. booleanisLocallyInitiated()Returns true if this stream was created by this peer. synchronized List<Header>takeResponseHeaders()Removes and returns the stream's received response headers, blocking if necessary until headershave been received. voidsendResponseHeaders(List<Header> responseHeaders, boolean out)Sends a reply to an incoming stream. TimeoutreadTimeout()TimeoutwriteTimeout()voidclose(ErrorCode rstStatusCode)Abnormally terminate this stream. voidcloseLater(ErrorCode errorCode)Abnormally terminate this stream. -
-
Method Detail
-
getId
int getId()
-
getConnection
Http2Connection getConnection()
-
getRequestHeaders
List<Header> getRequestHeaders()
-
getErrorCode
synchronized ErrorCode getErrorCode()
Returns the reason why this stream was closed, or null if it closed normally or has not yetbeen closed.
-
isOpen
synchronized boolean isOpen()
Returns true if this stream is open. A stream is open until either:
- A
{@code SYN_RESET}frame abnormally terminates the stream. - Both input and output streams have transmitted all data and headers.
Note that the input stream may continue to yield data even after a stream reports itself asnot open. This is because input data is buffered.
- A
-
isLocallyInitiated
boolean isLocallyInitiated()
Returns true if this stream was created by this peer.
-
takeResponseHeaders
synchronized List<Header> takeResponseHeaders()
Removes and returns the stream's received response headers, blocking if necessary until headershave been received. If the returned list contains multiple blocks of headers the blocks will bedelimited by 'null'.
-
sendResponseHeaders
void sendResponseHeaders(List<Header> responseHeaders, boolean out)
Sends a reply to an incoming stream.
- Parameters:
out- true to create an output stream that we can use to send data to the remote peer.
-
readTimeout
Timeout readTimeout()
-
writeTimeout
Timeout writeTimeout()
-
close
void close(ErrorCode rstStatusCode)
Abnormally terminate this stream. This blocks until the
{@code RST_STREAM}frame has beentransmitted.
-
closeLater
void closeLater(ErrorCode errorCode)
Abnormally terminate this stream. This enqueues a
{@code RST_STREAM}frame and returnsimmediately.
-
-
-
-