public static interface Http2Connection.Endpoint<F extends Http2FlowController>
Modifier and Type | Method and Description |
---|---|
boolean |
allowPushTo()
Gets whether or not server push is allowed to this endpoint.
|
void |
allowPushTo(boolean allow)
Sets whether server push is allowed to this 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 |
createIdleStream(int streamId)
Creates a stream initiated by this endpoint.
|
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.
|
int |
maxStreams()
The limit imposed by
maxActiveStreams() does not apply to streams in the IDLE state. |
void |
maxStreams(int maxActiveStreams,
int maxStreams)
Sets the limit for
SETTINGS_MAX_CONCURRENT_STREAMS and the limit for maxStreams() . |
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 createIdleStream(int streamId) throws Http2Exception
Note that IDLE streams can always be created so long as there are stream IDs available.
The numActiveStreams()
will be enforced upon attempting to open the stream.
If the stream is intended to initialized to Http2Stream.State.OPEN
then use
createStream(int, boolean)
otherwise optimizations in Http2Connection.Listener
s may not work
and memory may be thrashed. The caller is expected to Http2Stream.open(boolean)
the stream.
streamId
- The ID of the streamHttp2Exception
Http2Stream.open(boolean)
Http2Stream createStream(int streamId, boolean halfClosed) throws Http2Exception
canOpenStream()
is false
.
This method differs from createIdleStream(int)
because the initial state of the stream will be
Immediately set before notifying Http2Connection.Listener
s. The state transition is sensitive to halfClosed
and is defined by Http2Stream.open(boolean)
.
streamId
- The ID of the streamhalfClosed
- see Http2Stream.open(boolean)
.Http2Exception
Http2Stream.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.Http2Exception
boolean isServer()
void allowPushTo(boolean allow)
boolean allowPushTo()
int numActiveStreams()
OPEN
or HALF CLOSED
) that were created by this
endpoint.int maxActiveStreams()
SETTINGS_MAX_CONCURRENT_STREAMS
value sent from the opposite endpoint to
restrict stream creation by this endpoint.int maxStreams()
maxActiveStreams()
does not apply to streams in the IDLE state. Since IDLE
streams can still consume resources this limit will include streams in all states.void maxStreams(int maxActiveStreams, int maxStreams) throws Http2Exception
SETTINGS_MAX_CONCURRENT_STREAMS
and the limit for maxStreams()
.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.maxStreams
- The limit imposed by maxActiveStreams()
does not apply to streams in the IDLE
state. Since IDLE streams can still consume resources this limit will include streams in all states.Http2Exception
- if maxStreams < maxActiveStream
.int lastStreamCreated()
int lastStreamKnownByPeer()
-1
.F flowController()
void flowController(F flowController)
Http2Connection.Endpoint<? extends Http2FlowController> opposite()
Http2Connection.Endpoint
opposite this one.Copyright © 2008–2016 The Netty Project. All rights reserved.