static interface Http2Reader.Handler
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.
|
void |
data(boolean inFinished,
int streamId,
okio.BufferedSource source,
int length) |
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 ack,
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 settings) |
void |
windowUpdate(int streamId,
long windowSizeIncrement)
Notifies that an additional
windowSizeIncrement bytes can be sent on streamId , or the connection if streamId is zero. |
void data(boolean inFinished, int streamId, okio.BufferedSource source, int length) throws java.io.IOException
java.io.IOException
void headers(boolean inFinished, int streamId, int associatedStreamId, java.util.List<Header> headerBlock)
inFinished
- 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.void rstStream(int streamId, ErrorCode errorCode)
void settings(boolean clearPrevious, Settings settings)
void ackSettings()
void ping(boolean ack, int payload1, int payload2)
ack
indicates this is a reply. The data
in payload1
and payload2
opaque binary, and there are no rules on the
content.void goAway(int lastGoodStreamId, ErrorCode errorCode, okio.ByteString debugData)
ID >
lastGoodStreamId
on a new connection. In- flight streams with ID <=
lastGoodStreamId
can only be replayed on a new connection if they are idempotent.lastGoodStreamId
- 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.void windowUpdate(int streamId, long windowSizeIncrement)
windowSizeIncrement
bytes can be sent on streamId
, or the connection if streamId
is zero.void priority(int streamId, int streamDependency, int weight, boolean exclusive)
streamId
- 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
.void pushPromise(int streamId, int promisedStreamId, java.util.List<Header> requestHeaders) throws java.io.IOException
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
.
streamId
- 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}.java.io.IOException
void alternateService(int streamId, java.lang.String origin, okio.ByteString protocol, java.lang.String host, int port, long maxAge)
See alt-svc
streamId
- 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.