Package org.omegazero.net.nio.server
Class TLSServer
java.lang.Object
org.omegazero.net.nio.util.SelectorHandler
org.omegazero.net.nio.util.ConnectionSelectorHandler
org.omegazero.net.nio.server.TCPServer
org.omegazero.net.nio.server.TLSServer
- All Implemented Interfaces:
Runnable
,NetworkApplication
,NetServer
TLS server for TCP sockets.
- 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.TCPServer
backlog, bindAddresses, ports, workerCreator
-
Constructor Summary
ConstructorsConstructorDescriptionTLSServer
(Collection<InetAddress> bindAddresses, Collection<Integer> ports, int backlog, Function<SocketConnection, Consumer<Runnable>> workerCreator, long idleTimeout, SSLContext sslContext) -
Method Summary
Modifier and TypeMethodDescriptionString[]
protected ChannelConnection
handleConnection
(SelectionKey selectionKey) 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.TCPServer
close, getBacklog, getIdleTimeout, handleConnectionClosed, handleConnectionPost, handleSelectedKey, init, setConnectionCallback, setIdleTimeout, start
Methods inherited from class org.omegazero.net.nio.util.ConnectionSelectorHandler
loopIteration, onConnectionClosed
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
-
TLSServer
public TLSServer(Collection<InetAddress> bindAddresses, Collection<Integer> ports, int backlog, Function<SocketConnection, Consumer<Runnable>> workerCreator, long idleTimeout, SSLContext sslContext) - Parameters:
sslContext
- The SSL context to be used by the server- 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
- Specified by:
handleConnection
in classTCPServer
- Throws:
IOException
-