public final class SpdyStream extends Object
Modifier and Type | Field and Description |
---|---|
static int |
WINDOW_UPDATE_THRESHOLD
The number of unacknowledged bytes at which the input stream will send
the peer a
WINDOW_UPDATE frame. |
Modifier and Type | Method and Description |
---|---|
void |
close(ErrorCode rstStatusCode)
Abnormally terminate this stream.
|
void |
closeLater(ErrorCode errorCode)
Abnormally terminate this stream.
|
SpdyConnection |
getConnection() |
ErrorCode |
getErrorCode()
Returns the reason why this stream was closed, or null if it closed
normally or has not yet been closed.
|
InputStream |
getInputStream()
Returns an input stream that can be used to read data from the peer.
|
OutputStream |
getOutputStream()
Returns an output stream that can be used to write data to the peer.
|
long |
getReadTimeoutMillis() |
List<String> |
getRequestHeaders() |
List<String> |
getResponseHeaders()
Returns the stream's response headers, blocking if necessary if they
have not been received yet.
|
boolean |
isLocallyInitiated()
Returns true if this stream was created by this peer.
|
boolean |
isOpen()
Returns true if this stream is open.
|
void |
reply(List<String> responseHeaders,
boolean out)
Sends a reply to an incoming stream.
|
void |
setReadTimeout(long readTimeoutMillis)
Sets the maximum time to wait on input stream reads before failing with a
SocketTimeoutException , or 0 to wait indefinitely. |
public static final int WINDOW_UPDATE_THRESHOLD
WINDOW_UPDATE
frame. Must be less than this client's
window size, otherwise the remote peer will stop sending data on this
stream. (Chrome 25 uses 5 MiB.)public boolean isOpen()
SYN_RESET
frame abnormally terminates the stream.
public boolean isLocallyInitiated()
public SpdyConnection getConnection()
public List<String> getResponseHeaders() throws IOException
IOException
public ErrorCode getErrorCode()
public void reply(List<String> 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 void setReadTimeout(long readTimeoutMillis)
SocketTimeoutException
, or 0
to wait indefinitely.public long getReadTimeoutMillis()
public InputStream getInputStream()
public OutputStream getOutputStream()
IllegalStateException
- if this stream was initiated by the peer
and a reply(java.util.List<java.lang.String>, 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 © 2014. All rights reserved.