DISCARD_STREAM_TIMEOUT_MILLIS| Constructor and Description |
|---|
Http2Codec(Httpd client,
Interceptor.Chain chain,
StreamAllocation streamAllocation,
Http2Connection connection) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
取消这个流。这个流所持有的资源将被清理,尽管不是同步的。这可能会在连接池线程之后发生
|
Sink |
createRequestBody(Request request,
long contentLength)
返回一个可以对请求体进行流处理的输出流.
|
void |
finishRequest()
将请求刷新到基础套接字,就不会传输更多的字节.
|
void |
flushRequest()
将请求刷新到基础套接字.
|
static List<HttpHeaders> |
http2HeadersList(Request request) |
ResponseBody |
openResponseBody(Response response)
返回读取响应体的流.
|
static Response.Builder |
readHttp2HeadersList(Headers headerBlock,
Protocol protocol) |
Response.Builder |
readResponseHeaders(boolean expectContinue)
从HTTP传输解析响应头的字节
|
void |
writeRequestHeaders(Request request)
这应该更新HTTP引擎的sentRequestMillis字段.
|
public Http2Codec(Httpd client, Interceptor.Chain chain, StreamAllocation streamAllocation, Http2Connection connection)
public static List<HttpHeaders> http2HeadersList(Request request)
public static Response.Builder readHttp2HeadersList(Headers headerBlock, Protocol protocol) throws IOException
IOExceptionpublic Sink createRequestBody(Request request, long contentLength)
HttpCodeccreateRequestBody in interface HttpCodecrequest - 网络请求contentLength - 内容长度public void writeRequestHeaders(Request request) throws IOException
HttpCodecwriteRequestHeaders in interface HttpCodecrequest - 网络请求IOException - 异常public void flushRequest()
throws IOException
HttpCodecflushRequest in interface HttpCodecIOException - 异常public void finishRequest()
throws IOException
HttpCodecfinishRequest in interface HttpCodecIOException - 异常public Response.Builder readResponseHeaders(boolean expectContinue) throws IOException
HttpCodecreadResponseHeaders in interface HttpCodecexpectContinue - 如果这是一个带有“100”响应代码的中间响应,
则返回null。否则,此方法永远不会返回null.IOException - 异常public ResponseBody openResponseBody(Response response)
HttpCodecopenResponseBody in interface HttpCodecresponse - 响应Copyright © 2020. All rights reserved.