Package org.eclipse.jetty.http3
Class HTTP3Session
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.http3.HTTP3Session
- All Implemented Interfaces:
Session
,ParserListener
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
- Direct Known Subclasses:
HTTP3SessionClient
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.http3.parser.ParserListener
ParserListener.Wrapper
Nested classes/interfaces inherited from interface org.eclipse.jetty.http3.api.Session
Session.Client, Session.Listener, Session.Server
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected HTTP3Stream
createStream
(QuicStreamEndPoint endPoint, Consumer<Throwable> fail) void
dump
(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.long
Get the local socket address this session is bound to.int
protected HTTP3Stream
getOrCreateStream
(QuicStreamEndPoint endPoint) Get the remote socket address this session is connected to.protected HTTP3Stream
getStream
(long streamId) long
goAway
(boolean graceful) Initiates the shutdown of this session by sending a GOAWAY frame to the other peer.void
inwardClose
(long error, String reason) Called when a an external event wants to initiate the close of this session locally, for example a close at the network level (due to e.g.boolean
isClosed()
protected GoAwayFrame
newGoAwayFrame
(boolean graceful) protected abstract HTTP3Stream
newHTTP3Stream
(QuicStreamEndPoint endPoint, boolean local) void
Called when the local peer receives a close initiated by the remote peer.void
void
onGoAway
(GoAwayFrame frame) void
onHeaders
(long streamId, HeadersFrame frame, boolean wasBlocked) boolean
void
onOpen()
void
onSessionFailure
(long error, String reason, Throwable failure) void
onSettings
(SettingsFrame frame) void
onStreamFailure
(long streamId, long error, Throwable failure) void
removeStream
(HTTP3Stream stream, Throwable failure) void
setStreamIdleTimeout
(long streamIdleTimeout) shutdown()
toString()
abstract void
writeControlFrame
(Frame frame, Callback callback) abstract void
writeMessageFrame
(long streamId, Frame frame, Callback callback) Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListeners
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Constructor Details
-
HTTP3Session
-
-
Method Details
-
getProtocolSession
-
getListener
-
onOpen
public void onOpen() -
getLocalSocketAddress
Description copied from interface:Session
Get the local socket address this session is bound to.- Specified by:
getLocalSocketAddress
in interfaceSession
- Returns:
- the local socket address this session is bound to
-
getRemoteSocketAddress
Description copied from interface:Session
Get the remote socket address this session is connected to.- Specified by:
getRemoteSocketAddress
in interfaceSession
- Returns:
- the remote socket address this session is connected to
-
getStreams
- Specified by:
getStreams
in interfaceSession
- Returns:
- a snapshot of all the streams currently belonging to this session
-
getMaxLocalStreams
public int getMaxLocalStreams() -
goAway
Description copied from interface:Session
Initiates the shutdown of this session by sending a GOAWAY frame to the other peer.
- Specified by:
goAway
in interfaceSession
- Parameters:
graceful
- whether the shutdown should be graceful- Returns:
- the
CompletableFuture
that gets notified when the frame has been sent
-
newGoAwayFrame
-
shutdown
-
getIdleTimeout
public long getIdleTimeout() -
getStreamIdleTimeout
public long getStreamIdleTimeout() -
setStreamIdleTimeout
public void setStreamIdleTimeout(long streamIdleTimeout) -
createStream
-
getOrCreateStream
-
newHTTP3Stream
-
getStream
-
removeStream
-
writeControlFrame
-
writeMessageFrame
-
onPreface
-
onSettings
- Specified by:
onSettings
in interfaceParserListener
-
onHeaders
- Specified by:
onHeaders
in interfaceParserListener
-
onData
- Specified by:
onData
in interfaceParserListener
-
onGoAway
- Specified by:
onGoAway
in interfaceParserListener
-
onIdleTimeout
public boolean onIdleTimeout() -
inwardClose
Called when a an external event wants to initiate the close of this session locally, for example a close at the network level (due to e.g. stopping a component) or a timeout.
The correspondent passive event, where it's the remote peer that initiates the close, is delivered via
onClose(long, String)
.- Parameters:
error
- the close errorreason
- the close reason- See Also:
-
onClose
Called when the local peer receives a close initiated by the remote peer.
The correspondent active event, where it's the local peer that initiates the close, it's delivered via
inwardClose(long, String)
.- Parameters:
error
- the close errorreason
- the close reason
-
onStreamFailure
- Specified by:
onStreamFailure
in interfaceParserListener
-
onSessionFailure
- Specified by:
onSessionFailure
in interfaceParserListener
-
isClosed
public boolean isClosed() -
dump
Description copied from interface:Dumpable
Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dump
in interfaceDumpable
- Overrides:
dump
in classContainerLifeCycle
- Parameters:
out
- The appendable to dump toindent
- The indent to apply after any new lines.- Throws:
IOException
- if unable to write to Appendable
-
toString
- Overrides:
toString
in classAbstractLifeCycle
-