class Http2Connection.ReaderRunnable extends NamedRunnable implements Http2Reader.Handler
| Modifier and Type | Field and Description |
|---|---|
(package private) Http2Reader |
reader |
name| Constructor and Description |
|---|
ReaderRunnable(Http2Reader reader) |
| Modifier and Type | Method and Description |
|---|---|
void |
ackSettings()
HTTP/2 only.
|
void |
alternateService(int streamId,
java.lang.String origin,
okio.ByteString protocol,
java.lang.String host,
int port,
long maxAge)
HTTP/2 only.
|
private void |
applyAndAckSettings(Settings peerSettings) |
void |
data(boolean inFinished,
int streamId,
okio.BufferedSource source,
int length) |
protected void |
execute() |
void |
goAway(int lastGoodStreamId,
ErrorCode errorCode,
okio.ByteString debugData)
The peer tells us to stop creating streams.
|
void |
headers(boolean inFinished,
int streamId,
int associatedStreamId,
java.util.List<Header> headerBlock)
Create or update incoming headers, creating the corresponding streams if necessary.
|
void |
ping(boolean reply,
int payload1,
int payload2)
Read a connection-level ping from the peer.
|
void |
priority(int streamId,
int streamDependency,
int weight,
boolean exclusive)
Called when reading a headers or priority frame.
|
void |
pushPromise(int streamId,
int promisedStreamId,
java.util.List<Header> requestHeaders)
HTTP/2 only.
|
void |
rstStream(int streamId,
ErrorCode errorCode) |
void |
settings(boolean clearPrevious,
Settings newSettings) |
void |
windowUpdate(int streamId,
long windowSizeIncrement)
Notifies that an additional
windowSizeIncrement bytes can be sent on streamId, or the connection if streamId is zero. |
runfinal Http2Reader reader
ReaderRunnable(Http2Reader reader)
protected void execute()
execute in class NamedRunnablepublic void data(boolean inFinished,
int streamId,
okio.BufferedSource source,
int length)
throws java.io.IOException
data in interface Http2Reader.Handlerjava.io.IOExceptionpublic void headers(boolean inFinished,
int streamId,
int associatedStreamId,
java.util.List<Header> headerBlock)
Http2Reader.Handlerheaders in interface Http2Reader.HandlerinFinished - true if the sender will not send further frames.streamId - the stream owning these headers.associatedStreamId - the stream that triggered the sender to create this stream.public void rstStream(int streamId,
ErrorCode errorCode)
rstStream in interface Http2Reader.Handlerpublic void settings(boolean clearPrevious,
Settings newSettings)
settings in interface Http2Reader.Handlerprivate void applyAndAckSettings(Settings peerSettings)
public void ackSettings()
Http2Reader.HandlerackSettings in interface Http2Reader.Handlerpublic void ping(boolean reply,
int payload1,
int payload2)
Http2Reader.Handlerack indicates this is a reply. The data
in payload1 and payload2 opaque binary, and there are no rules on the
content.ping in interface Http2Reader.Handlerpublic void goAway(int lastGoodStreamId,
ErrorCode errorCode,
okio.ByteString debugData)
Http2Reader.HandlerID >
lastGoodStreamId on a new connection. In- flight streams with ID <=
lastGoodStreamId can only be replayed on a new connection if they are idempotent.goAway in interface Http2Reader.HandlerlastGoodStreamId - the last stream ID the peer processed before sending this message. If
lastGoodStreamId is zero, the peer processed no frames.errorCode - reason for closing the connection.debugData - only valid for HTTP/2; opaque debug data to send.public void windowUpdate(int streamId,
long windowSizeIncrement)
Http2Reader.HandlerwindowSizeIncrement bytes can be sent on streamId, or the connection if streamId is zero.windowUpdate in interface Http2Reader.Handlerpublic void priority(int streamId,
int streamDependency,
int weight,
boolean exclusive)
Http2Reader.Handlerpriority in interface Http2Reader.HandlerstreamId - stream which has a priority change.streamDependency - the stream ID this stream is dependent on.weight - relative proportion of priority in [1..256].exclusive - inserts this stream ID as the sole child of streamDependency.public void pushPromise(int streamId,
int promisedStreamId,
java.util.List<Header> requestHeaders)
Http2Reader.Handler A push promise contains all the headers
that pertain to a server-initiated request, and a promisedStreamId to which response
frames will be delivered. Push promise frames are sent as a part of the response to streamId.
pushPromise in interface Http2Reader.HandlerstreamId - client-initiated stream ID. Must be an odd number.promisedStreamId - server-initiated stream ID. Must be an even number.requestHeaders - minimally includes :method, :scheme, :authority, and (@code :path}.public void alternateService(int streamId,
java.lang.String origin,
okio.ByteString protocol,
java.lang.String host,
int port,
long maxAge)
Http2Reader.HandlerSee alt-svc
alternateService in interface Http2Reader.HandlerstreamId - when a client-initiated stream ID (odd number), the origin of this alternate
service is the origin of the stream. When zero, the origin is specified in the origin
parameter.origin - when present, the origin is
typically represented as a combination of scheme, host and port. When empty, the origin is
that of the streamId.protocol - an ALPN protocol, such as h2.host - an IP address or hostname.port - the IP port associated with the service.maxAge - time in seconds that this alternative is considered fresh.