public final class FramedStream extends Object
Modifier and Type | Method and Description |
---|---|
void |
close(ErrorCode rstStatusCode)
Abnormally terminate this stream.
|
void |
closeLater(ErrorCode errorCode)
Abnormally terminate this stream.
|
FramedConnection |
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() |
List<Header> |
getResponseHeaders()
Returns the stream's response headers, blocking if necessary if they
have not been received yet.
|
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 |
reply(List<Header> responseHeaders,
boolean out)
Sends a reply to an incoming stream.
|
okio.Timeout |
writeTimeout() |
public int getId()
public boolean isOpen()
SYN_RESET
frame abnormally terminates the stream.
public boolean isLocallyInitiated()
public FramedConnection getConnection()
public List<Header> getResponseHeaders() throws IOException
IOException
public ErrorCode getErrorCode()
public void reply(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 reply(java.util.List<com.squareup.okhttp.internal.framed.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 © 2016. All rights reserved.