public final class Http2Stream extends Object
Modifier and Type | Method and Description |
---|---|
void |
close(ErrorCode rstStatusCode)
Abnormally terminate this stream.
|
void |
closeLater(ErrorCode errorCode)
Abnormally terminate this stream.
|
Http2Connection |
getConnection() |
ErrorCode |
getErrorCode()
Returns the reason why this stream was closed, or null if it closed normally or has not yet
been closed.
|
int |
getId() |
List<Header> |
getRequestHeaders() |
okio.Sink |
getSink()
Returns a sink that can be used to write data to the peer.
|
okio.Source |
getSource()
Returns a source that reads data from the peer.
|
boolean |
isLocallyInitiated()
Returns true if this stream was created by this peer.
|
boolean |
isOpen()
Returns true if this stream is open.
|
okio.Timeout |
readTimeout() |
void |
sendResponseHeaders(List<Header> responseHeaders,
boolean out)
Sends a reply to an incoming stream.
|
List<Header> |
takeResponseHeaders()
Removes and returns the stream's received response headers, blocking if necessary until headers
have been received.
|
okio.Timeout |
writeTimeout() |
public int getId()
public boolean isOpen()
SYN_RESET
frame abnormally terminates the stream.
Note that the input stream may continue to yield data even after a stream reports itself as not open. This is because input data is buffered.
public boolean isLocallyInitiated()
public Http2Connection getConnection()
public List<Header> takeResponseHeaders() throws IOException
IOException
public ErrorCode getErrorCode()
public void sendResponseHeaders(List<Header> responseHeaders, boolean out) throws IOException
out
- true to create an output stream that we can use to send data to the remote peer.
Corresponds to FLAG_FIN
.IOException
public okio.Timeout readTimeout()
public okio.Timeout writeTimeout()
public okio.Source getSource()
public okio.Sink getSink()
IllegalStateException
- if this stream was initiated by the peer and a sendResponseHeaders(java.util.List<okhttp3.internal.http2.Header>, boolean)
has not yet been sent.public void close(ErrorCode rstStatusCode) throws IOException
RST_STREAM
frame has been
transmitted.IOException
public void closeLater(ErrorCode errorCode)
RST_STREAM
frame and returns
immediately.Copyright © 2019. All rights reserved.