public final class Http2Connection extends Object implements Closeable
Many methods in this API are synchronous: the call is completed before the method returns. This is typical for Java but atypical for HTTP/2. This is motivated by exception transparency: an IOException that was triggered by a certain caller can be caught and handled by that caller.
| Modifier and Type | Class and Description |
|---|---|
static class |
Http2Connection.Builder |
static class |
Http2Connection.Listener |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
Protocol |
getProtocol() |
boolean |
isShutdown() |
int |
maxConcurrentStreams() |
Http2Stream |
newStream(List<Header> requestHeaders,
boolean out) |
int |
openStreamCount() |
Http2Stream |
pushStream(int associatedStreamId,
List<Header> requestHeaders,
boolean out) |
void |
setSettings(Settings settings) |
void |
shutdown(ErrorCode statusCode) |
void |
start() |
void |
writeData(int streamId,
boolean outFinished,
Buffer buffer,
long byteCount) |
public Protocol getProtocol()
public int openStreamCount()
public int maxConcurrentStreams()
public Http2Stream pushStream(int associatedStreamId, List<Header> requestHeaders, boolean out) throws IOException
IOExceptionpublic Http2Stream newStream(List<Header> requestHeaders, boolean out) throws IOException
IOExceptionpublic void writeData(int streamId,
boolean outFinished,
Buffer buffer,
long byteCount)
throws IOException
IOExceptionpublic void flush()
throws IOException
IOExceptionpublic void shutdown(ErrorCode statusCode) throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void start()
throws IOException
IOExceptionpublic void setSettings(Settings settings) throws IOException
IOExceptionpublic boolean isShutdown()
Copyright © 2019. All rights reserved.