Class DTLSServer

All Implemented Interfaces:
Runnable, NetworkApplication, NetServer

public class DTLSServer extends UDPServer
TLS server for UDP sockets (DTLS).
  • Constructor Details

    • DTLSServer

      public DTLSServer(Collection<Integer> ports, SSLContext sslContext)
      Parameters:
      sslContext - The SSL context to be used by the server. The context must be initialized with protocol "DTLS"
      See Also:
      • UDPServer#UDPServer(String, Collection, Consumer, long, int)
    • DTLSServer

      public DTLSServer(Collection<InetAddress> bindAddresses, Collection<Integer> ports, Consumer<Runnable> worker, 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:
      • UDPServer#UDPServer(String, Collection, Consumer, long, int)
  • Method Details

    • setSupportedApplicationLayerProtocols

      public void setSupportedApplicationLayerProtocols(String[] supportedApplicationLayerProtocols)
      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 or null 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

      public String[] 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 class UDPServer
      Throws:
      IOException