- All Implemented Interfaces:
org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.Dumpable.DumpableContainer,org.eclipse.jetty.util.component.LifeCycle
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
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainer -
Field Summary
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedQuicSession(Executor executor, org.eclipse.jetty.util.thread.Scheduler scheduler, org.eclipse.jetty.io.ByteBufferPool byteBufferPool, org.eclipse.jetty.quic.quiche.QuicheConnection quicheConnection, QuicConnection connection, SocketAddress remoteAddress) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ProtocolSessionprotected voiddoStart()protected voiddoStop()voiddump(Appendable out, String indent) intfill(long streamId, ByteBuffer buffer) voidflush()intflush(long streamId, ByteBuffer buffer, boolean last) org.eclipse.jetty.io.ByteBufferPoolorg.eclipse.jetty.quic.quiche.QuicheConnectionIdlongintgetOrCreateStreamEndPoint(long streamId, Consumer<QuicStreamEndPoint> consumer) Returns the peer certificates chain.org.eclipse.jetty.util.thread.SchedulerlonglonggetWindowCapacity(long streamId) voidinwardClose(long error, String reason) booleanbooleanisFinished(long streamId) abstract org.eclipse.jetty.io.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()protected abstract booleanMethods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, 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, 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
dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Constructor Details
-
QuicSession
protected QuicSession(Executor executor, org.eclipse.jetty.util.thread.Scheduler scheduler, org.eclipse.jetty.io.ByteBufferPool byteBufferPool, org.eclipse.jetty.quic.quiche.QuicheConnection quicheConnection, QuicConnection connection, SocketAddress remoteAddress)
-
-
Method Details
-
doStart
-
doStop
-
shutdown
-
getExecutor
-
getScheduler
public org.eclipse.jetty.util.thread.Scheduler getScheduler() -
getByteBufferPool
public org.eclipse.jetty.io.ByteBufferPool 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
-
validateNewlyEstablishedConnection
protected abstract boolean validateNewlyEstablishedConnection()- Returns:
- true if the connection is valid, false otherwise.
-
newConnection
-
flush
public void flush() -
getOrCreateStreamEndPoint
public QuicStreamEndPoint getOrCreateStreamEndPoint(long streamId, Consumer<QuicStreamEndPoint> consumer) -
inwardClose
-
outwardClose
-
getPeerCertificates
Returns the peer certificates chain.
Due to current Quiche C API limitations (that the Rust version does not have), only the last certificate in the chain is returned. This may change in the future when the C APIs are aligned to the Rust APIs.
- Returns:
- the peer certificates chain (currently only the last certificate in the chain)
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Overrides:
dumpin classorg.eclipse.jetty.util.component.ContainerLifeCycle- Throws:
IOException
-
toString
- Overrides:
toStringin classorg.eclipse.jetty.util.component.AbstractLifeCycle
-