Top Description Inners Fields Constructors Methods
org.eclipse.jetty.quic.server

public Class QuicServerConnector

extends AbstractNetworkConnector
Class Inheritance
Imports
java.io.IOException, java.net.InetSocketAddress, java.nio.channels.DatagramChannel, .SelectableChannel, .SelectionKey, java.nio.file.Files, .Path, java.security.KeyStore, java.util.EventListener, .List, .Set, java.util.concurrent.CompletableFuture, .Executor, org.eclipse.jetty.io.ByteBufferPool, .Connection, .DatagramChannelEndPoint, .EndPoint, .ManagedSelector, .SelectorManager, org.eclipse.jetty.quic.common.QuicConfiguration, .QuicSession, .QuicSessionContainer, .QuicStreamEndPoint, org.eclipse.jetty.quic.quiche.PemExporter, .QuicheConfig, org.eclipse.jetty.server.AbstractNetworkConnector, .ConnectionFactory, .Server, org.eclipse.jetty.util.IO, org.eclipse.jetty.util.ssl.SslContextFactory, org.eclipse.jetty.util.thread.Scheduler

A server side network connector that uses a DatagramChannel to listen on a network port for QUIC traffic.

This connector uses ConnectionFactorys to configure the protocols to support. The protocol is negotiated during the connection establishment by QuicSession, and for each QUIC stream managed by a QuicSession a ConnectionFactory is used to create a Connection for the correspondent QuicStreamEndPoint.

See Also
QuicConfiguration

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private Path
private final QuicSessionContainer
private volatile DatagramChannel
private int
private volatile int
private int
private Path
private final QuicConfiguration
private final QuicServerConnector.ServerDatagramSelectorManager
private final SslContextFactory.Server
private Path
private boolean
private boolean

Constructor Summary

AccessConstructor and Description
public
QuicServerConnector(Server server, SslContextFactory.Server sslContextFactory, ConnectionFactory... factories)

public
QuicServerConnector(Server server, Executor executor, Scheduler scheduler, ByteBufferPool bufferPool, SslContextFactory.Server sslContextFactory, ConnectionFactory... factories)

Method Summary

Modifier and TypeMethod and Description
protected void
accept(int acceptorID)

Implements abstract org.eclipse.jetty.server.AbstractConnector.accept.

private void
protected void
doStart()

Overrides org.eclipse.jetty.server.AbstractNetworkConnector.doStart.

Starts the managed lifecycle beans in the order they were added.

protected void
doStop()

Overrides org.eclipse.jetty.server.AbstractNetworkConnector.doStop.

Stops the managed lifecycle beans in the reverse order they were added.

private Path
public int
public int
public int
public QuicConfiguration
public Object
getTransport()

Implements org.eclipse.jetty.server.Connector.getTransport.

Get the underlying socket, channel, buffer etc. for the connector..

public boolean
isOpen()

Implements org.eclipse.jetty.server.NetworkConnector.isOpen.

A Connector may be opened and not started (to reserve a port) or closed and running (to allow graceful shutdown of existing connections)

public boolean
public boolean
protected ServerQuicConnection
protected EndPoint
newEndPoint(DatagramChannel channel, ManagedSelector selector, SelectionKey selectionKey)

pack-priv QuicheConfig
public void
open()

Overrides org.eclipse.jetty.server.AbstractNetworkConnector.open.

Implements org.eclipse.jetty.server.NetworkConnector.open.

Performs the activities needed to open the network communication (for example, to start accepting incoming network connections).

protected DatagramChannel
public void
setIdleTimeout(long idleTimeout)

Overrides org.eclipse.jetty.server.AbstractConnector.setIdleTimeout.

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.

public void
setInputBufferSize(int inputBufferSize)

public void
setOutputBufferSize(int outputBufferSize)

public void
setUseInputDirectByteBuffers(boolean useInputDirectByteBuffers)

public void
setUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers)

public CompletableFuture<Void>
Inherited from org.eclipse.jetty.server.AbstractNetworkConnector:
closegetHostgetPorthandleAcceptFailuresetHostsetPorttoString

Field Detail

certificateChainPemPathback to summary
private Path certificateChainPemPath
containerback to summary
private final QuicSessionContainer container
datagramChannelback to summary
private volatile DatagramChannel datagramChannel
inputBufferSizeback to summary
private int inputBufferSize
localPortback to summary
private volatile int localPort
outputBufferSizeback to summary
private int outputBufferSize
privateKeyPemPathback to summary
private Path privateKeyPemPath
quicConfigurationback to summary
private final QuicConfiguration quicConfiguration
selectorManagerback to summary
private final QuicServerConnector.ServerDatagramSelectorManager selectorManager
sslContextFactoryback to summary
private final SslContextFactory.Server sslContextFactory
trustedCertificatesPemPathback to summary
private Path trustedCertificatesPemPath
useInputDirectByteBuffersback to summary
private boolean useInputDirectByteBuffers
useOutputDirectByteBuffersback to summary
private boolean useOutputDirectByteBuffers

Constructor Detail

QuicServerConnectorback to summary
public QuicServerConnector(Server server, SslContextFactory.Server sslContextFactory, ConnectionFactory... factories)
QuicServerConnectorback to summary
public QuicServerConnector(Server server, Executor executor, Scheduler scheduler, ByteBufferPool bufferPool, SslContextFactory.Server sslContextFactory, ConnectionFactory... factories)

Method Detail

acceptback to summary
protected void accept(int acceptorID)

Implements abstract org.eclipse.jetty.server.AbstractConnector.accept.

Annotations
@Override
deleteFileback to summary
private void deleteFile(Path file)
doStartback to summary
protected void doStart() throws Exception

Overrides org.eclipse.jetty.server.AbstractNetworkConnector.doStart.

Doc from org.eclipse.jetty.util.component.ContainerLifeCycle.doStart.

Starts the managed lifecycle beans in the order they were added.

Annotations
@Override
Exceptions
Exception:

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

If there was a problem starting. Will cause a transition to FAILED state

doStopback to summary
protected void doStop() throws Exception

Overrides org.eclipse.jetty.server.AbstractNetworkConnector.doStop.

Doc from org.eclipse.jetty.util.component.ContainerLifeCycle.doStop.

Stops the managed lifecycle beans in the reverse order they were added.

Annotations
@Override
Exceptions
Exception:

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

If there was a problem stopping. Will cause a transition to FAILED state

findPemWorkDirectoryback to summary
private Path findPemWorkDirectory()
getInputBufferSizeback to summary
public int getInputBufferSize()
getLocalPortback to summary
public int getLocalPort()

Overrides org.eclipse.jetty.server.AbstractNetworkConnector.getLocalPort.

Implements org.eclipse.jetty.server.NetworkConnector.getLocalPort.

Annotations
@Override
getOutputBufferSizeback to summary
public int getOutputBufferSize()
getQuicConfigurationback to summary
public QuicConfiguration getQuicConfiguration()
getTransportback to summary
public Object getTransport()

Implements org.eclipse.jetty.server.Connector.getTransport.

Doc from org.eclipse.jetty.server.Connector.getTransport.

Get the underlying socket, channel, buffer etc. for the connector..

Annotations
@Override
isOpenback to summary
public boolean isOpen()

Implements org.eclipse.jetty.server.NetworkConnector.isOpen.

Doc from org.eclipse.jetty.server.NetworkConnector.isOpen.

A Connector may be opened and not started (to reserve a port) or closed and running (to allow graceful shutdown of existing connections)

Annotations
@Override
isUseInputDirectByteBuffersback to summary
public boolean isUseInputDirectByteBuffers()
isUseOutputDirectByteBuffersback to summary
public boolean isUseOutputDirectByteBuffers()
newConnectionback to summary
protected ServerQuicConnection newConnection(EndPoint endpoint)
newEndPointback to summary
protected EndPoint newEndPoint(DatagramChannel channel, ManagedSelector selector, SelectionKey selectionKey)
newQuicheConfigback to summary
pack-priv QuicheConfig newQuicheConfig()
openback to summary
public void open() throws IOException

Overrides org.eclipse.jetty.server.AbstractNetworkConnector.open.

Implements org.eclipse.jetty.server.NetworkConnector.open.

Doc from org.eclipse.jetty.server.NetworkConnector.open.

Performs the activities needed to open the network communication (for example, to start accepting incoming network connections).

Annotations
@Override
Exceptions
IOException:
if this connector cannot be opened
openDatagramChannelback to summary
protected DatagramChannel openDatagramChannel() throws IOException
setIdleTimeoutback to summary
public void setIdleTimeout(long idleTimeout)

Overrides org.eclipse.jetty.server.AbstractConnector.setIdleTimeout.

Doc from org.eclipse.jetty.server.AbstractConnector.setIdleTimeout.

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.

Annotations
@Override
setInputBufferSizeback to summary
public void setInputBufferSize(int inputBufferSize)
setOutputBufferSizeback to summary
public void setOutputBufferSize(int outputBufferSize)
setUseInputDirectByteBuffersback to summary
public void setUseInputDirectByteBuffers(boolean useInputDirectByteBuffers)
setUseOutputDirectByteBuffersback to summary
public void setUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers)
shutdownback to summary
public CompletableFuture<Void> shutdown()

Overrides org.eclipse.jetty.server.AbstractNetworkConnector.shutdown.

Implements org.eclipse.jetty.util.component.Graceful.shutdown.

Doc from org.eclipse.jetty.util.component.Graceful.shutdown.

Shutdown the component. When this method returns, the component should not accept any new load.

Annotations
@Override
org.eclipse.jetty.quic.server back to summary

private Class QuicServerConnector.ServerDatagramSelectorManager

extends SelectorManager
Class Inheritance

Field Summary

Inherited from org.eclipse.jetty.io.SelectorManager:
DEFAULT_CONNECT_TIMEOUTLOG

Constructor Summary

AccessConstructor and Description
protected
ServerDatagramSelectorManager(Executor executor, Scheduler scheduler, int selectors)

Method Summary

Modifier and TypeMethod and Description
protected void
endPointClosed(EndPoint endpoint)

Overrides org.eclipse.jetty.io.SelectorManager.endPointClosed.

Callback method invoked when an endpoint is closed.

protected void
endPointOpened(EndPoint endpoint)

Overrides org.eclipse.jetty.io.SelectorManager.endPointOpened.

Callback method invoked when an endpoint is opened.

public Connection
newConnection(SelectableChannel channel, EndPoint endpoint, Object attachment)

Implements abstract org.eclipse.jetty.io.SelectorManager.newConnection.

Factory method to create Connection.

protected EndPoint
newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey selectionKey)

Implements abstract org.eclipse.jetty.io.SelectorManager.newEndPoint.

Factory method to create EndPoint.

private void
setIdleTimeout(long idleTimeout)

Inherited from org.eclipse.jetty.io.SelectorManager:
acceptacceptacceptedacceptoraddEventListenerchooseSelectorconnectconnectionClosedconnectionFailedconnectionOpeneddoAcceptdoFinishConnectdoStartdoStopexecutegetConnectTimeoutgetExecutorgetSchedulergetSelectorCountgetTotalKeysisConnectionPendingnewSelectornewSelectoronAcceptedonAcceptFailedonAcceptingremoveEventListenersetConnectTimeouttoString

Constructor Detail

ServerDatagramSelectorManagerback to summary
protected ServerDatagramSelectorManager(Executor executor, Scheduler scheduler, int selectors)

Method Detail

endPointClosedback to summary
protected void endPointClosed(EndPoint endpoint)

Overrides org.eclipse.jetty.io.SelectorManager.endPointClosed.

Doc from org.eclipse.jetty.io.SelectorManager.endPointClosed.

Callback method invoked when an endpoint is closed.

Annotations
@Override
endPointOpenedback to summary
protected void endPointOpened(EndPoint endpoint)

Overrides org.eclipse.jetty.io.SelectorManager.endPointOpened.

Doc from org.eclipse.jetty.io.SelectorManager.endPointOpened.

Callback method invoked when an endpoint is opened.

Annotations
@Override
newConnectionback to summary
public Connection newConnection(SelectableChannel channel, EndPoint endpoint, Object attachment)

Implements abstract org.eclipse.jetty.io.SelectorManager.newConnection.

Doc from org.eclipse.jetty.io.SelectorManager.newConnection.

Factory method to create Connection.

Annotations
@Override
newEndPointback to summary
protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey selectionKey)

Implements abstract org.eclipse.jetty.io.SelectorManager.newEndPoint.

Doc from org.eclipse.jetty.io.SelectorManager.newEndPoint.

Factory method to create EndPoint.

This method is invoked as a result of the registration of a channel via connect(SelectableChannel, Object) or accept(SelectableChannel).

Annotations
@Override
setIdleTimeoutback to summary
private void setIdleTimeout(long idleTimeout)