Class QuicServerConnector
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.server.AbstractConnector
-
- org.eclipse.jetty.server.AbstractNetworkConnector
-
- org.eclipse.jetty.quic.server.QuicServerConnector
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,Connector
,NetworkConnector
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,Graceful
,LifeCycle
- Direct Known Subclasses:
HTTP3ServerConnector
public class QuicServerConnector extends AbstractNetworkConnector
A server side network connector that uses a
DatagramChannel
to listen on a network port for QUIC traffic.This connector uses
ConnectionFactory
s to configure the protocols to support. The protocol is negotiated during the connection establishment byQuicSession
, and for each QUIC stream managed by aQuicSession
aConnectionFactory
is used to create aConnection
for the correspondentQuicStreamEndPoint
.- See Also:
QuicConfiguration
-
-
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.Graceful
Graceful.Shutdown, Graceful.ThrowingRunnable
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Field Summary
-
Fields inherited from class org.eclipse.jetty.server.AbstractConnector
LOG
-
-
Constructor Summary
Constructors Constructor Description QuicServerConnector(Server server, java.util.concurrent.Executor executor, Scheduler scheduler, ByteBufferPool bufferPool, SslContextFactory.Server sslContextFactory, ConnectionFactory... factories)
QuicServerConnector(Server server, SslContextFactory.Server sslContextFactory, ConnectionFactory... factories)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
accept(int acceptorID)
protected void
doStart()
Starts the managed lifecycle beans in the order they were added.protected void
doStop()
Stops the managed lifecycle beans in the reverse order they were added.int
getInputBufferSize()
int
getLocalPort()
int
getOutputBufferSize()
QuicConfiguration
getQuicConfiguration()
java.lang.Object
getTransport()
boolean
isOpen()
A Connector may be opened and not started (to reserve a port) or closed and running (to allow graceful shutdown of existing connections)boolean
isUseInputDirectByteBuffers()
boolean
isUseOutputDirectByteBuffers()
void
open()
Performs the activities needed to open the network communication (for example, to start accepting incoming network connections).protected java.nio.channels.DatagramChannel
openDatagramChannel()
void
setIdleTimeout(long idleTimeout)
Sets the maximum Idle time for a connection, which roughly translates to theSocket.setSoTimeout(int)
call, although with NIO implementations other mechanisms may be used to implement the timeout.void
setInputBufferSize(int inputBufferSize)
void
setOutputBufferSize(int outputBufferSize)
void
setUseInputDirectByteBuffers(boolean useInputDirectByteBuffers)
void
setUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers)
java.util.concurrent.CompletableFuture<java.lang.Void>
shutdown()
Shutdown the component.-
Methods inherited from class org.eclipse.jetty.server.AbstractNetworkConnector
close, getHost, getPort, handleAcceptFailure, setHost, setPort, toString
-
Methods inherited from class org.eclipse.jetty.server.AbstractConnector
addConnectionFactory, addFirstConnectionFactory, addIfAbsentConnectionFactory, clearConnectionFactories, getAcceptorPriorityDelta, getAcceptors, getByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getDefaultProtocol, getExecutor, getHttpChannelListeners, getIdleTimeout, getName, getProtocols, getScheduler, getServer, getShutdownIdleTimeout, interruptAcceptors, isAccepting, isShutdown, join, join, onEndPointClosed, onEndPointOpened, removeConnectionFactory, setAccepting, setAcceptorPriorityDelta, setConnectionFactories, setDefaultProtocol, setName, setShutdownIdleTimeout
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, 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.server.Connector
getByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getExecutor, getIdleTimeout, getName, getProtocols, getScheduler, getServer
-
Methods inherited from interface org.eclipse.jetty.util.component.Container
addBean, addBean, addEventListener, getBean, getBeans, getBeans, getCachedBeans, getContainedBeans, getEventListeners, isManaged, manage, removeBean, removeEventListener, unmanage
-
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Methods inherited from interface org.eclipse.jetty.util.component.Graceful
isShutdown
-
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
-
-
-
-
Constructor Detail
-
QuicServerConnector
public QuicServerConnector(Server server, SslContextFactory.Server sslContextFactory, ConnectionFactory... factories)
-
QuicServerConnector
public QuicServerConnector(Server server, java.util.concurrent.Executor executor, Scheduler scheduler, ByteBufferPool bufferPool, SslContextFactory.Server sslContextFactory, ConnectionFactory... factories)
-
-
Method Detail
-
getQuicConfiguration
public QuicConfiguration getQuicConfiguration()
-
getLocalPort
public int getLocalPort()
- Specified by:
getLocalPort
in interfaceNetworkConnector
- Overrides:
getLocalPort
in classAbstractNetworkConnector
- Returns:
- The actual port the connector is listening on, or -1 if it has not been opened, or -2 if it has been closed.
-
getInputBufferSize
public int getInputBufferSize()
-
setInputBufferSize
public void setInputBufferSize(int inputBufferSize)
-
getOutputBufferSize
public int getOutputBufferSize()
-
setOutputBufferSize
public void setOutputBufferSize(int outputBufferSize)
-
isUseInputDirectByteBuffers
public boolean isUseInputDirectByteBuffers()
-
setUseInputDirectByteBuffers
public void setUseInputDirectByteBuffers(boolean useInputDirectByteBuffers)
-
isUseOutputDirectByteBuffers
public boolean isUseOutputDirectByteBuffers()
-
setUseOutputDirectByteBuffers
public void setUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers)
-
isOpen
public boolean isOpen()
Description copied from interface:NetworkConnector
A Connector may be opened and not started (to reserve a port) or closed and running (to allow graceful shutdown of existing connections)- Returns:
- True if the connector is Open.
-
doStart
protected void doStart() throws java.lang.Exception
Description copied from class:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in classAbstractNetworkConnector
- Throws:
AbstractLifeCycle.StopException
- If thrown, the lifecycle will immediately be stopped.java.lang.Exception
- If there was a problem starting. Will cause a transition to FAILED state
-
open
public void open() throws java.io.IOException
Description copied from interface:NetworkConnector
Performs the activities needed to open the network communication (for example, to start accepting incoming network connections).
- Specified by:
open
in interfaceNetworkConnector
- Overrides:
open
in classAbstractNetworkConnector
- Throws:
java.io.IOException
- if this connector cannot be opened- See Also:
NetworkConnector.close()
-
openDatagramChannel
protected java.nio.channels.DatagramChannel openDatagramChannel() throws java.io.IOException
- Throws:
java.io.IOException
-
setIdleTimeout
public void setIdleTimeout(long idleTimeout)
Description copied from class:AbstractConnector
Sets the maximum Idle time for a connection, which roughly translates to the
Socket.setSoTimeout(int)
call, although with NIO implementations other mechanisms may be used to implement the timeout.The max idle time is applied:
- When waiting for a new message to be received on a connection
- When waiting for a new message to be sent on a connection
This value is interpreted as the maximum time between some progress being made on the connection. So if a single byte is read or written, then the timeout is reset.
- Overrides:
setIdleTimeout
in classAbstractConnector
- Parameters:
idleTimeout
- the idle timeout
-
doStop
protected void doStop() throws java.lang.Exception
Description copied from class:ContainerLifeCycle
Stops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStop
in classAbstractNetworkConnector
- Throws:
java.lang.Exception
- If there was a problem stopping. Will cause a transition to FAILED state
-
shutdown
public java.util.concurrent.CompletableFuture<java.lang.Void> shutdown()
Description copied from interface:Graceful
Shutdown the component. When this method returns, the component should not accept any new load.- Specified by:
shutdown
in interfaceGraceful
- Overrides:
shutdown
in classAbstractNetworkConnector
- Returns:
- A future that is completed once all load on the component is completed
-
getTransport
public java.lang.Object getTransport()
- Returns:
- the underlying socket, channel, buffer etc. for the connector.
-
accept
protected void accept(int acceptorID)
- Specified by:
accept
in classAbstractConnector
-
-