Package org.eclipse.jetty.quic.common
Class QuicSession
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.quic.common.QuicSession
- All Implemented Interfaces:
Container,Destroyable,Dumpable,Dumpable.DumpableContainer,LifeCycle
- Direct Known Subclasses:
ClientQuicSession,ServerQuicSession
Represents a logical connection with a remote peer, identified by a QUIC connection ID.
Each QuicSession maintains a number of QUIC streams, identified by their QUIC stream ID;
Each QUIC stream is wrapped in an EndPoint, namely QuicStreamEndPoint.
Bytes received from a QuicConnection in process(SocketAddress, ByteBuffer)
are passed to Quiche for processing; in turn, Quiche produces a list of QUIC stream IDs that
have pending I/O events, either read-ready or write-ready.
On the receive side, a QuicSession fans-out to multiple QuicStreamEndPoints.
On the send side, many QuicStreamEndPoints fan-in to a QuicSession.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer -
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedQuicSession(Executor executor, Scheduler scheduler, ByteBufferPool byteBufferPool, org.eclipse.jetty.quic.quiche.QuicheConnection quicheConnection, QuicConnection connection, SocketAddress remoteAddress) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ProtocolSessionprotected voiddoStart()Starts the managed lifecycle beans in the order they were added.protected voiddoStop()Stops the managed lifecycle beans in the reverse order they were added.voiddump(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.intfill(long streamId, ByteBuffer buffer) voidflush()intflush(long streamId, ByteBuffer buffer, boolean last) org.eclipse.jetty.quic.quiche.QuicheConnectionIdlongintgetOrCreateStreamEndPoint(long streamId, Consumer<QuicStreamEndPoint> consumer) longlonggetWindowCapacity(long streamId) voidinwardClose(long error, String reason) booleanbooleanisFinished(long streamId) abstract ConnectionnewConnection(QuicStreamEndPoint endPoint) longnewStreamId(StreamType streamType) voidbooleanvoidoutwardClose(long error, String reason) protected RunnablepollTask()process(SocketAddress remoteAddress, ByteBuffer cipherBufferIn) voidremove(QuicStreamEndPoint endPoint, Throwable failure) voidsetConnectionId(org.eclipse.jetty.quic.quiche.QuicheConnectionId quicheConnectionId) voidsetIdleTimeout(long idleTimeout) shutdown()voidshutdownInput(long streamId, long error) voidshutdownOutput(long streamId, long error) toString()Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Constructor Details
-
QuicSession
protected QuicSession(Executor executor, Scheduler scheduler, ByteBufferPool byteBufferPool, org.eclipse.jetty.quic.quiche.QuicheConnection quicheConnection, QuicConnection connection, SocketAddress remoteAddress)
-
-
Method Details
-
doStart
Description copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
doStartin classContainerLifeCycle- Throws:
AbstractLifeCycle.StopException- If thrown, the lifecycle will immediately be stopped.Exception- If there was a problem starting. Will cause a transition to FAILED state
-
doStop
Description copied from class:ContainerLifeCycleStops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStopin classContainerLifeCycle- Throws:
Exception- If there was a problem stopping. Will cause a transition to FAILED state
-
shutdown
-
getExecutor
-
getScheduler
-
getByteBufferPool
-
getProtocolSession
-
getMaxLocalStreams
public int getMaxLocalStreams() -
getNegotiatedProtocol
-
getQuicConnection
-
getQuicStreamEndPoints
-
getRemoteCloseInfo
-
getIdleTimeout
public long getIdleTimeout() -
setIdleTimeout
public void setIdleTimeout(long idleTimeout) -
onIdleTimeout
public boolean onIdleTimeout() -
onFailure
-
newStreamId
- Parameters:
streamType- the stream type- Returns:
- a new stream ID for the given type
-
fill
- Throws:
IOException
-
flush
- Throws:
IOException
-
isFinished
public boolean isFinished(long streamId) -
getWindowCapacity
public long getWindowCapacity() -
getWindowCapacity
- Throws:
IOException
-
shutdownInput
- Throws:
IOException
-
shutdownOutput
- Throws:
IOException
-
remove
-
getLocalAddress
-
getRemoteAddress
-
isConnectionEstablished
public boolean isConnectionEstablished() -
getConnectionId
public org.eclipse.jetty.quic.quiche.QuicheConnectionId getConnectionId() -
setConnectionId
public void setConnectionId(org.eclipse.jetty.quic.quiche.QuicheConnectionId quicheConnectionId) -
process
- Throws:
IOException
-
pollTask
-
createProtocolSession
-
newConnection
-
flush
public void flush() -
getOrCreateStreamEndPoint
public QuicStreamEndPoint getOrCreateStreamEndPoint(long streamId, Consumer<QuicStreamEndPoint> consumer) -
inwardClose
-
outwardClose
-
dump
Description copied from interface:DumpableDump 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:
dumpin interfaceDumpable- Overrides:
dumpin 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:
toStringin classAbstractLifeCycle
-