Package org.omegazero.net.nio.server
Class DTLSServer
java.lang.Object
org.omegazero.net.nio.util.SelectorHandler
org.omegazero.net.nio.util.ConnectionSelectorHandler
org.omegazero.net.nio.server.UDPServer
org.omegazero.net.nio.server.DTLSServer
- All Implemented Interfaces:
Runnable
,NetworkApplication
,NetServer
TLS server for UDP sockets (DTLS).
- API Note:
- Before version 2.1.0, this class was in package
org.omegazero.net.server
.
-
Field Summary
Fields inherited from class org.omegazero.net.nio.server.UDPServer
bindAddresses, ports, workerCreator
-
Constructor Summary
ConstructorsConstructorDescriptionDTLSServer
(Collection<InetAddress> bindAddresses, Collection<Integer> ports, Function<SocketConnection, Consumer<Runnable>> workerCreator, long idleTimeout, int receiveBufferSize, SSLContext sslContext) -
Method Summary
Modifier and TypeMethodDescriptionString[]
protected ChannelConnection
handleConnection
(SelectionKey serverKey, SocketAddress remote) void
setSupportedApplicationLayerProtocols
(String[] supportedApplicationLayerProtocols) Sets the list of supported application layer protocol names to be negotiated using TLS ALPN (Application Layer Protocol Negotiation).Methods inherited from class org.omegazero.net.nio.server.UDPServer
close, getIdleTimeout, handleConnectionPost, handleSelectedKey, init, onConnectionClosed, setConnectionCallback, setIdleTimeout, start, writeBacklogStarted
Methods inherited from class org.omegazero.net.nio.util.ConnectionSelectorHandler
handleConnectionClosed, loopIteration
Methods inherited from class org.omegazero.net.nio.util.SelectorHandler
closeSelector, initSelector, isRunning, registerChannel, registerChannel, runSelectorLoop, selectorKeys, selectorWakeup
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.omegazero.net.common.NetworkApplication
run
-
Constructor Details
-
DTLSServer
public DTLSServer(Collection<InetAddress> bindAddresses, Collection<Integer> ports, Function<SocketConnection, Consumer<Runnable>> workerCreator, long idleTimeout, int receiveBufferSize, SSLContext sslContext) - Parameters:
sslContext
- The SSL context to be used by the server. The context must be initialized with protocol "DTLS"- See Also:
-
-
Method Details
-
setSupportedApplicationLayerProtocols
Sets the list of supported application layer protocol names to be negotiated using TLS ALPN (Application Layer Protocol Negotiation). The elements in this list should be ordered from most-preferred to least-preferred protocol name.
If not set ornull
is passed, the first protocol name presented by the client is selected. If the client does not request ALPN, this list is ignored.- Parameters:
supportedApplicationLayerProtocols
- The list of supported protocol names
-
getSupportedApplicationLayerProtocols
- Returns:
- The list of configured supported application layer protocol names, or
null
of none were configured
-
handleConnection
protected ChannelConnection handleConnection(SelectionKey serverKey, SocketAddress remote) throws IOException - Specified by:
handleConnection
in classUDPServer
- Throws:
IOException
-