public static interface Http2Connection.Endpoint<F extends Http2FlowController>
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
allowPushTo()
This is the SETTINGS_ENABLE_PUSH value sent
from the opposite endpoint.
|
void |
allowPushTo(boolean allow)
This is the SETTINGS_ENABLE_PUSH value sent
from the opposite endpoint.
|
boolean |
canOpenStream()
Indicates whether or a stream created by this endpoint can be opened without violating
maxActiveStreams(). |
boolean |
created(Http2Stream stream)
Indicates whether or not this endpoint created the given stream.
|
Http2Stream |
createStream(int streamId,
boolean halfClosed)
Creates a stream initiated by this endpoint.
|
F |
flowController()
Gets the flow controller for this endpoint.
|
void |
flowController(F flowController)
Sets the flow controller for this endpoint.
|
int |
incrementAndGetNextStreamId()
Increment and get the next generated stream id this endpoint.
|
boolean |
isServer()
Indicates whether or not this endpoint is the server-side of the connection.
|
boolean |
isValidStreamId(int streamId)
Indicates whether the given streamId is from the set of IDs used by this endpoint to
create new streams.
|
int |
lastStreamCreated()
Gets the ID of the stream last successfully created by this endpoint.
|
int |
lastStreamKnownByPeer()
If a GOAWAY was received for this endpoint, this will be the last stream ID from the
GOAWAY frame.
|
int |
maxActiveStreams()
Gets the maximum number of streams (created by this endpoint) that are allowed to be active at
the same time.
|
void |
maxActiveStreams(int maxActiveStreams)
Sets the limit for
SETTINGS_MAX_CONCURRENT_STREAMS. |
boolean |
mayHaveCreatedStream(int streamId)
Indicates whether or not this endpoint may have created the given stream.
|
int |
numActiveStreams()
Gets the number of active streams (i.e.
|
Http2Connection.Endpoint<? extends Http2FlowController> |
opposite()
Gets the
Http2Connection.Endpoint opposite this one. |
Http2Stream |
reservePushStream(int streamId,
Http2Stream parent)
Creates a push stream in the reserved state for this endpoint and notifies all listeners.
|
int incrementAndGetNextStreamId()
boolean isValidStreamId(int streamId)
boolean mayHaveCreatedStream(int streamId)
true if
isValidStreamId(int) and streamId <= lastStreamCreated().boolean created(Http2Stream stream)
boolean canOpenStream()
maxActiveStreams().Http2Stream createStream(int streamId, boolean halfClosed) throws Http2Exception
canOpenStream() is false.
The initial state of the stream will be immediately set before notifying Http2Connection.Listeners. The state
transition is sensitive to halfClosed and is defined by Http2Stream.open(boolean).
streamId - The ID of the streamhalfClosed - see Http2Stream.open(boolean).Http2ExceptionHttp2Stream.open(boolean)Http2Stream reservePushStream(int streamId, Http2Stream parent) throws Http2Exception
OPEN from the side sending the push
promise.streamId - the ID of the push streamparent - the parent stream used to initiate the push stream.Http2Exceptionboolean isServer()
void allowPushTo(boolean allow)
SETTINGS frame.boolean allowPushTo()
true for the client endpoint and always false
for a server endpoint.int numActiveStreams()
OPEN or HALF CLOSED) that were created by this
endpoint.int maxActiveStreams()
The default value returned by this method must be "unlimited".
void maxActiveStreams(int maxActiveStreams)
SETTINGS_MAX_CONCURRENT_STREAMS.maxActiveStreams - The maximum number of streams (created by this endpoint) that are allowed to be
active at once. This is the
SETTINGS_MAX_CONCURRENT_STREAMS value sent
from the opposite endpoint to restrict stream creation by this endpoint.int lastStreamCreated()
int lastStreamKnownByPeer()
-1.F flowController()
void flowController(F flowController)
Http2Connection.Endpoint<? extends Http2FlowController> opposite()
Http2Connection.Endpoint opposite this one.